Bug 682996 - Remove Panorama group name from titlebar r=tim
This commit is contained in:
@@ -52,7 +52,6 @@ let TabView = {
|
|||||||
PREF_RESTORE_ENABLED_ONCE: "browser.panorama.session_restore_enabled_once",
|
PREF_RESTORE_ENABLED_ONCE: "browser.panorama.session_restore_enabled_once",
|
||||||
GROUPS_IDENTIFIER: "tabview-groups",
|
GROUPS_IDENTIFIER: "tabview-groups",
|
||||||
VISIBILITY_IDENTIFIER: "tabview-visibility",
|
VISIBILITY_IDENTIFIER: "tabview-visibility",
|
||||||
LAST_SESSION_GROUP_NAME_IDENTIFIER: "tabview-last-session-group-name",
|
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
get windowTitle() {
|
get windowTitle() {
|
||||||
@@ -143,10 +142,6 @@ let TabView = {
|
|||||||
"TabShow", this._tabShowEventListener, false);
|
"TabShow", this._tabShowEventListener, false);
|
||||||
gBrowser.tabContainer.addEventListener(
|
gBrowser.tabContainer.addEventListener(
|
||||||
"TabClose", this._tabCloseEventListener, false);
|
"TabClose", this._tabCloseEventListener, false);
|
||||||
|
|
||||||
// grab the last used group title
|
|
||||||
this._lastSessionGroupName = sessionstore.getWindowValue(window,
|
|
||||||
this.LAST_SESSION_GROUP_NAME_IDENTIFIER);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,30 +274,6 @@ let TabView = {
|
|||||||
else
|
else
|
||||||
this.show();
|
this.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
getActiveGroupName: function TabView_getActiveGroupName() {
|
|
||||||
if (!this._window)
|
|
||||||
return this._lastSessionGroupName;
|
|
||||||
|
|
||||||
// We get the active group this way, instead of querying
|
|
||||||
// GroupItems.getActiveGroupItem() because the tabSelect event
|
|
||||||
// will not have happened by the time the browser tries to
|
|
||||||
// update the title.
|
|
||||||
let groupItem = null;
|
|
||||||
let activeTab = window.gBrowser.selectedTab;
|
|
||||||
let activeTabItem = activeTab._tabViewTabItem;
|
|
||||||
|
|
||||||
if (activeTab.pinned) {
|
|
||||||
// It's an app tab, so it won't have a .tabItem. However, its .parent
|
|
||||||
// will already be set as the active group.
|
|
||||||
groupItem = this._window.GroupItems.getActiveGroupItem();
|
|
||||||
} else if (activeTabItem) {
|
|
||||||
groupItem = activeTabItem.parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
// groupItem may still be null, if the active tab is an orphan.
|
|
||||||
return groupItem ? groupItem.getTitle() : "";
|
|
||||||
},
|
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
updateContextMenu: function TabView_updateContextMenu(tab, popup) {
|
updateContextMenu: function TabView_updateContextMenu(tab, popup) {
|
||||||
|
|||||||
@@ -813,12 +813,6 @@
|
|||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
if ("TabView" in window) {
|
|
||||||
let groupName = TabView.getActiveGroupName();
|
|
||||||
if (groupName)
|
|
||||||
newTitle = groupName + sep + newTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
return newTitle;
|
return newTitle;
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -214,15 +214,6 @@ let Storage = {
|
|||||||
win, win.TabView.VISIBILITY_IDENTIFIER, data);
|
win, win.TabView.VISIBILITY_IDENTIFIER, data);
|
||||||
},
|
},
|
||||||
|
|
||||||
// ----------
|
|
||||||
// Function: saveActiveGroupName
|
|
||||||
// Saves the active group's name for the given window.
|
|
||||||
saveActiveGroupName: function Storage_saveActiveGroupName(win) {
|
|
||||||
let groupName = win.TabView.getActiveGroupName();
|
|
||||||
this._sessionStore.setWindowValue(
|
|
||||||
win, win.TabView.LAST_SESSION_GROUP_NAME_IDENTIFIER, groupName);
|
|
||||||
},
|
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
// Function: saveData
|
// Function: saveData
|
||||||
// Generic routine for saving data to a window.
|
// Generic routine for saving data to a window.
|
||||||
|
|||||||
@@ -295,7 +295,6 @@ let UI = {
|
|||||||
TabItems.saveAll();
|
TabItems.saveAll();
|
||||||
TabItems.saveAllThumbnails({synchronously: true});
|
TabItems.saveAllThumbnails({synchronously: true});
|
||||||
|
|
||||||
Storage.saveActiveGroupName(gWindow);
|
|
||||||
self._save();
|
self._save();
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ _BROWSER_FILES = \
|
|||||||
browser_tabview_bug591706.js \
|
browser_tabview_bug591706.js \
|
||||||
browser_tabview_bug593283.js \
|
browser_tabview_bug593283.js \
|
||||||
browser_tabview_bug594958.js \
|
browser_tabview_bug594958.js \
|
||||||
browser_tabview_bug595020.js \
|
|
||||||
browser_tabview_bug595191.js \
|
browser_tabview_bug595191.js \
|
||||||
browser_tabview_bug595436.js \
|
browser_tabview_bug595436.js \
|
||||||
browser_tabview_bug595518.js \
|
browser_tabview_bug595518.js \
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
/* Any copyright is dedicated to the Public Domain.
|
|
||||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
||||||
|
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
|
||||||
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user