Bug 1364516 - Move gCustomizeMode.setTab call out of updateTabLabelAndIcon. r=mikedeboer

While setTab does end up setting the label and icon, it also does completely different and more crucial things. This call really doesn't belong in updateTabLabelAndIcon.

MozReview-Commit-ID: 1ZSY17ThNx

--HG--
extra : rebase_source : 7406be1314e50665b2a4aa612916e93846ac32f1
This commit is contained in:
Dão Gottwald 2017-05-15 18:52:34 +02:00
Родитель 0582261474
Коммит 17f07e92b9
1 изменённых файлов: 9 добавлений и 5 удалений

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

@ -2618,9 +2618,7 @@ var SessionStoreInternal = {
/**
* Updates the label and icon for a <xul:tab> using the data from
* tabData. If the tab being updated happens to be the
* customization mode tab, this function will tell the window's
* CustomizeMode instance about it.
* tabData.
*
* @param tab
* The <xul:tab> to update.
@ -2629,6 +2627,10 @@ var SessionStoreInternal = {
* not supplied, the data will be retrieved from the cache.
*/
updateTabLabelAndIcon(tab, tabData = null) {
if (tab.hasAttribute("customizemode")) {
return;
}
let browser = tab.linkedBrowser;
let win = browser.ownerGlobal;
@ -2648,8 +2650,6 @@ var SessionStoreInternal = {
} else if (activePageData.url != "about:blank") {
win.gBrowser.setInitialTabTitle(tab, activePageData.url);
}
} else if (tab.hasAttribute("customizemode")) {
win.gCustomizeMode.setTab(tab);
}
// Restore the tab icon.
@ -3692,6 +3692,10 @@ var SessionStoreInternal = {
};
}
if (tab.hasAttribute("customizemode")) {
window.gCustomizeMode.setTab(tab);
}
// Update tab label and icon to show something
// while we wait for the messages to be processed.
this.updateTabLabelAndIcon(tab, tabData);