gecko-dev/browser/components/tabview/tabview.js
Carsten "Tomcat" Book 08997000eb Backed out 2 changesets (bug 1202902) to recking bug 1202902 to be able to reopen inbound on a CLOSED TREE
Backed out changeset 647025383676 (bug 1202902)
Backed out changeset d70c7fe532c6 (bug 1202902)
2015-10-07 14:03:21 +02:00

84 lines
2.5 KiB
JavaScript

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