Bug 594644 part 2 r=dietrich a=blocking

This commit is contained in:
Ian Gilman 2010-11-22 16:28:38 -08:00
Родитель 25af3ca225
Коммит c6f197c772
2 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -1559,6 +1559,7 @@ let GroupItems = {
_arrangePaused: false,
_arrangesPending: [],
_removingHiddenGroups: false,
_updatingTabBarPaused: false,
// ----------
// Function: init
@ -1991,6 +1992,25 @@ let GroupItems = {
this._activeOrphanTab = tabItem;
},
// ----------
// Function: pauseUpdatingTabBar
// Don't update the tab bar until resume is called.
pauseUpdatingTabBar: function GroupItems_pauseUdatingTabBar() {
Utils.assertThrow(!this._updatingTabBarPaused, "shouldn't already be paused");
this._updatingTabBarPaused = true;
},
// ----------
// Function: resumeUpdatingTabBar
// Allows updating the tab bar, and does an update.
resumeUpdatingTabBar: function GroupItems_resumeUpdatingTabBar() {
Utils.assertThrow(this._updatingTabBarPaused, "should already be paused");
this._updatingTabBarPaused = false;
this._updateTabBar();
},
// ----------
// Function: _updateTabBar
// Hides and shows tabs in the tab bar based on the active groupItem or
@ -1998,6 +2018,9 @@ let GroupItems = {
_updateTabBar: function GroupItems__updateTabBar() {
if (!window.UI)
return; // called too soon
if (this._updatingTabBarPaused)
return;
if (!this._activeGroupItem && !this._activeOrphanTab) {
Utils.assert(false, "There must be something to show in the tab bar!");

Просмотреть файл

@ -537,6 +537,7 @@ let UI = {
self._privateBrowsing.transitionStage = 0;
self._privateBrowsing.transitionMode = "";
TabItems.resumeReconnecting();
GroupItems.resumeUpdatingTabBar();
}
}
@ -571,6 +572,7 @@ let UI = {
if (aData == "enter" || aData == "exit") {
self._privateBrowsing.transitionStage = 1;
self._privateBrowsing.transitionMode = aData;
GroupItems.pauseUpdatingTabBar();
TabItems.pauseReconnecting();
}
}