michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: const Cc = Components.classes; michael@0: const Ci = Components.interfaces; michael@0: const Cu = Components.utils; michael@0: const Cr = Components.results; michael@0: michael@0: Cu.import("resource:///modules/tabview/utils.jsm"); michael@0: Cu.import("resource://gre/modules/Services.jsm"); michael@0: Cu.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: michael@0: XPCOMUtils.defineLazyGetter(this, "tabviewBundle", function() { michael@0: return Services.strings. michael@0: createBundle("chrome://browser/locale/tabview.properties"); michael@0: }); michael@0: XPCOMUtils.defineLazyGetter(this, "tabbrowserBundle", function() { michael@0: return Services.strings. michael@0: createBundle("chrome://browser/locale/tabbrowser.properties"); michael@0: }); michael@0: michael@0: function tabviewString(name) tabviewBundle.GetStringFromName('tabview.' + name); michael@0: function tabbrowserString(name) tabbrowserBundle.GetStringFromName(name); michael@0: michael@0: XPCOMUtils.defineLazyGetter(this, "gPrefBranch", function() { michael@0: return Services.prefs.getBranch("browser.panorama."); michael@0: }); michael@0: michael@0: XPCOMUtils.defineLazyModuleGetter(this, "gPageThumbnails", michael@0: "resource://gre/modules/PageThumbs.jsm", "PageThumbs"); michael@0: michael@0: var gWindow = window.parent; michael@0: var gBrowser = gWindow.gBrowser; michael@0: var gTabView = gWindow.TabView; michael@0: var gTabViewDeck = gWindow.document.getElementById("tab-view-deck"); michael@0: var gBrowserPanel = gWindow.document.getElementById("browser-panel"); michael@0: var gTabViewFrame = gWindow.document.getElementById("tab-view"); michael@0: michael@0: let AllTabs = { michael@0: _events: { michael@0: attrModified: "TabAttrModified", michael@0: close: "TabClose", michael@0: move: "TabMove", michael@0: open: "TabOpen", michael@0: select: "TabSelect", michael@0: pinned: "TabPinned", michael@0: unpinned: "TabUnpinned" michael@0: }, michael@0: michael@0: get tabs() { michael@0: return Array.filter(gBrowser.tabs, function (tab) Utils.isValidXULTab(tab)); michael@0: }, michael@0: michael@0: register: function AllTabs_register(eventName, callback) { michael@0: gBrowser.tabContainer.addEventListener(this._events[eventName], callback, false); michael@0: }, michael@0: michael@0: unregister: function AllTabs_unregister(eventName, callback) { michael@0: gBrowser.tabContainer.removeEventListener(this._events[eventName], callback, false); michael@0: } michael@0: }; michael@0: michael@0: # NB: Certain files need to evaluate before others michael@0: michael@0: #include iq.js michael@0: #include storage.js michael@0: #include items.js michael@0: #include groupitems.js michael@0: #include tabitems.js michael@0: #include favicons.js michael@0: #include drag.js michael@0: #include trench.js michael@0: #include search.js michael@0: #include telemetry.js michael@0: #include ui.js