2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
|
|
|
|
2011-07-23 08:07:39 -07:00
|
|
|
"use strict";
|
|
|
|
|
2010-08-11 15:28:45 -07:00
|
|
|
const Cc = Components.classes;
|
|
|
|
const Ci = Components.interfaces;
|
|
|
|
const Cu = Components.utils;
|
2011-05-30 13:02:04 -07:00
|
|
|
const Cr = Components.results;
|
2010-08-11 15:28:45 -07:00
|
|
|
|
2010-09-06 00:17:26 -07:00
|
|
|
Cu.import("resource:///modules/tabview/utils.jsm");
|
2010-08-11 15:28:45 -07:00
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
|
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
2010-07-28 21:56:31 -07:00
|
|
|
|
2010-09-09 07:06:00 -07:00
|
|
|
XPCOMUtils.defineLazyGetter(this, "tabviewBundle", function() {
|
|
|
|
return Services.strings.
|
|
|
|
createBundle("chrome://browser/locale/tabview.properties");
|
|
|
|
});
|
2011-11-30 21:53:44 -08:00
|
|
|
XPCOMUtils.defineLazyGetter(this, "tabbrowserBundle", function() {
|
|
|
|
return Services.strings.
|
|
|
|
createBundle("chrome://browser/locale/tabbrowser.properties");
|
|
|
|
});
|
2010-09-09 07:06:00 -07:00
|
|
|
|
|
|
|
function tabviewString(name) tabviewBundle.GetStringFromName('tabview.' + name);
|
2011-11-30 21:53:44 -08:00
|
|
|
function tabbrowserString(name) tabbrowserBundle.GetStringFromName(name);
|
2010-09-09 07:06:00 -07:00
|
|
|
|
2010-09-20 18:26:00 -07:00
|
|
|
XPCOMUtils.defineLazyGetter(this, "gPrefBranch", function() {
|
2011-01-12 00:51:20 -08:00
|
|
|
return Services.prefs.getBranch("browser.panorama.");
|
2010-09-20 18:26:00 -07:00
|
|
|
});
|
|
|
|
|
2012-04-18 23:24:32 -07:00
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "gPageThumbnails",
|
|
|
|
"resource:///modules/PageThumbs.jsm", "PageThumbs");
|
2011-02-19 10:22:49 -08:00
|
|
|
|
2011-02-16 08:06:54 -08:00
|
|
|
var gWindow = window.parent;
|
|
|
|
var gBrowser = gWindow.gBrowser;
|
|
|
|
var gTabView = gWindow.TabView;
|
|
|
|
var gTabViewDeck = gWindow.document.getElementById("tab-view-deck");
|
2011-04-13 20:28:58 -07:00
|
|
|
var gBrowserPanel = gWindow.document.getElementById("browser-panel");
|
2011-02-16 08:06:54 -08:00
|
|
|
var gTabViewFrame = gWindow.document.getElementById("tab-view");
|
|
|
|
|
2011-08-21 01:41:17 -07:00
|
|
|
let AllTabs = {
|
|
|
|
_events: {
|
|
|
|
attrModified: "TabAttrModified",
|
|
|
|
close: "TabClose",
|
|
|
|
move: "TabMove",
|
|
|
|
open: "TabOpen",
|
|
|
|
select: "TabSelect",
|
|
|
|
pinned: "TabPinned",
|
|
|
|
unpinned: "TabUnpinned"
|
|
|
|
},
|
|
|
|
|
|
|
|
get tabs() {
|
2012-04-10 11:13:36 -07:00
|
|
|
return Array.filter(gBrowser.tabs, function (tab) Utils.isValidXULTab(tab));
|
2011-08-21 01:41:17 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-07-28 21:56:31 -07:00
|
|
|
# NB: Certain files need to evaluate before others
|
2010-07-22 12:35:11 -07:00
|
|
|
|
2010-07-29 12:37:25 -07:00
|
|
|
#include iq.js
|
|
|
|
#include storage.js
|
|
|
|
#include items.js
|
2010-08-06 15:46:55 -07:00
|
|
|
#include groupitems.js
|
2010-07-29 12:37:25 -07:00
|
|
|
#include tabitems.js
|
2012-04-13 16:04:57 -07:00
|
|
|
#include favicons.js
|
2010-07-29 12:37:25 -07:00
|
|
|
#include drag.js
|
|
|
|
#include trench.js
|
2010-09-08 11:37:50 -07:00
|
|
|
#include search.js
|
2012-04-29 10:53:08 -07:00
|
|
|
#include telemetry.js
|
2011-09-29 21:17:00 -07:00
|
|
|
#include ui.js
|