mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 00:02:37 +00:00
Bug 791683 - Remove legacy code parts from Panorama; r=felipe
This commit is contained in:
parent
bb92ccb47c
commit
e6e814a715
@ -11,7 +11,6 @@ let TabView = {
|
||||
_closedLastVisibleTabBeforeFrameInitialized: false,
|
||||
_isFrameLoading: false,
|
||||
_initFrameCallbacks: [],
|
||||
_lastSessionGroupName: null,
|
||||
PREF_BRANCH: "browser.panorama.",
|
||||
PREF_FIRST_RUN: "browser.panorama.experienced_first_run",
|
||||
PREF_STARTUP_PAGE: "browser.startup.page",
|
||||
|
@ -34,7 +34,6 @@ function GroupItem(listOfEls, options) {
|
||||
this._inited = false;
|
||||
this._uninited = false;
|
||||
this._children = []; // an array of Items
|
||||
this.defaultSize = new Point(TabItems.tabWidth * 1.5, TabItems.tabHeight * 1.5);
|
||||
this.isAGroupItem = true;
|
||||
this.id = options.id || GroupItems.getNextID();
|
||||
this._isStacked = false;
|
||||
@ -2111,18 +2110,6 @@ let GroupItems = {
|
||||
return result;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: getStorageData
|
||||
// Returns an object for saving GroupItems state to persistent storage.
|
||||
getStorageData: function GroupItems_getStorageData() {
|
||||
var data = {nextID: this.nextID, groupItems: []};
|
||||
this.groupItems.forEach(function(groupItem) {
|
||||
data.groupItems.push(groupItem.getStorageData());
|
||||
});
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: saveAll
|
||||
// Saves GroupItems state, as well as the state of all of the groupItems.
|
||||
|
@ -17,9 +17,6 @@
|
||||
//
|
||||
// Subclasses of Item must also provide the <Subscribable> interface.
|
||||
//
|
||||
// ... and this property:
|
||||
// defaultSize - a Point
|
||||
//
|
||||
// Make sure to call _init() from your subclass's constructor.
|
||||
function Item() {
|
||||
// Variable: isAnItem
|
||||
@ -102,7 +99,6 @@ Item.prototype = {
|
||||
Utils.assert(typeof this.setZ == 'function', 'Subclass must provide setZ');
|
||||
Utils.assert(typeof this.close == 'function', 'Subclass must provide close');
|
||||
Utils.assert(typeof this.save == 'function', 'Subclass must provide save');
|
||||
Utils.assert(Utils.isPoint(this.defaultSize), 'Subclass must provide defaultSize');
|
||||
Utils.assert(Utils.isRect(this.bounds), 'Subclass must provide bounds');
|
||||
|
||||
this.container = container;
|
||||
|
@ -36,29 +36,6 @@ let Storage = {
|
||||
this._sessionStore = null;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: wipe
|
||||
// Cleans out all the stored data, leaving empty objects.
|
||||
wipe: function Storage_wipe() {
|
||||
try {
|
||||
var self = this;
|
||||
|
||||
// ___ Tabs
|
||||
AllTabs.tabs.forEach(function(tab) {
|
||||
self.saveTab(tab, null);
|
||||
});
|
||||
|
||||
// ___ Other
|
||||
this.saveGroupItemsData(gWindow, {});
|
||||
this.saveUIData(gWindow, {});
|
||||
|
||||
this._sessionStore.setWindowValue(gWindow, this.GROUP_DATA_IDENTIFIER,
|
||||
JSON.stringify({}));
|
||||
} catch (e) {
|
||||
Utils.log("Error in wipe: "+e);
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: saveTab
|
||||
// Saves the data for a single tab.
|
||||
|
@ -41,7 +41,6 @@ function TabItem(tab, options) {
|
||||
|
||||
this.tabCanvas = new TabCanvas(this.tab, this.$canvas[0]);
|
||||
|
||||
this.defaultSize = new Point(TabItems.tabWidth, TabItems.tabHeight);
|
||||
this._hidden = false;
|
||||
this.isATabItem = true;
|
||||
this.keepProportional = true;
|
||||
|
@ -1,37 +0,0 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let stateStartup = {windows:[
|
||||
{tabs:[{entries:[{url:"about:home"}]}], extData:{"tabview-last-session-group-name":"title"}}
|
||||
]};
|
||||
|
||||
function test() {
|
||||
let assertWindowTitle = function (win, title) {
|
||||
let browser = win.gBrowser.tabs[0].linkedBrowser;
|
||||
let winTitle = win.gBrowser.getWindowTitleForBrowser(browser);
|
||||
|
||||
info('window title is: "' + winTitle + '"');
|
||||
is(winTitle.indexOf(title), 0, "title starts with '" + title + "'");
|
||||
};
|
||||
|
||||
let testGroupNameChange = function (win) {
|
||||
showTabView(function () {
|
||||
let cw = win.TabView.getContentWindow();
|
||||
let groupItem = cw.GroupItems.groupItems[0];
|
||||
groupItem.setTitle("new-title");
|
||||
|
||||
hideTabView(function () {
|
||||
assertWindowTitle(win, "new-title");
|
||||
finish();
|
||||
}, win);
|
||||
}, win);
|
||||
};
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
newWindowWithState(stateStartup, function (win) {
|
||||
registerCleanupFunction(function () win.close());
|
||||
assertWindowTitle(win, "title");
|
||||
testGroupNameChange(win);
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user