зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1419734 - Remove tab statistics leftovers. r=jdescottes
MozReview-Commit-ID: GaMCH6BrFMP --HG-- extra : rebase_source : 653a330ca1ce0efbf4d943e0da5952d737ada25c
This commit is contained in:
Родитель
af2e5d5dd1
Коммит
94383e3026
|
@ -60,13 +60,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||
*/
|
||||
_toolbars: new WeakMap(),
|
||||
|
||||
_tabStats: {
|
||||
peakOpen: 0,
|
||||
peakPinned: 0,
|
||||
histOpen: [],
|
||||
histPinned: []
|
||||
},
|
||||
|
||||
/**
|
||||
* This function is for the benefit of Tools:DevToolbox in
|
||||
* browser/base/content/browser-sets.inc and should not be used outside
|
||||
|
@ -474,10 +467,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||
|
||||
let tabContainer = win.gBrowser.tabContainer;
|
||||
tabContainer.addEventListener("TabSelect", this);
|
||||
tabContainer.addEventListener("TabOpen", this);
|
||||
tabContainer.addEventListener("TabClose", this);
|
||||
tabContainer.addEventListener("TabPinned", this);
|
||||
tabContainer.addEventListener("TabUnpinned", this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -709,35 +698,10 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||
|
||||
let tabContainer = win.gBrowser.tabContainer;
|
||||
tabContainer.removeEventListener("TabSelect", this);
|
||||
tabContainer.removeEventListener("TabOpen", this);
|
||||
tabContainer.removeEventListener("TabClose", this);
|
||||
tabContainer.removeEventListener("TabPinned", this);
|
||||
tabContainer.removeEventListener("TabUnpinned", this);
|
||||
},
|
||||
|
||||
handleEvent(event) {
|
||||
switch (event.type) {
|
||||
case "TabOpen":
|
||||
case "TabClose":
|
||||
case "TabPinned":
|
||||
case "TabUnpinned":
|
||||
let open = 0;
|
||||
let pinned = 0;
|
||||
|
||||
for (let win of this._trackedBrowserWindows) {
|
||||
let tabContainer = win.gBrowser.tabContainer;
|
||||
let numPinnedTabs = win.gBrowser._numPinnedTabs || 0;
|
||||
let numTabs = tabContainer.itemCount - numPinnedTabs;
|
||||
|
||||
open += numTabs;
|
||||
pinned += numPinnedTabs;
|
||||
}
|
||||
|
||||
this._tabStats.histOpen.push(open);
|
||||
this._tabStats.histPinned.push(pinned);
|
||||
this._tabStats.peakOpen = Math.max(open, this._tabStats.peakOpen);
|
||||
this._tabStats.peakPinned = Math.max(pinned, this._tabStats.peakPinned);
|
||||
break;
|
||||
case "TabSelect":
|
||||
gDevToolsBrowser._updateMenuCheckbox();
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче