browser/components/tabview/tabview.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 "use strict";
     7 const Cc = Components.classes;
     8 const Ci = Components.interfaces;
     9 const Cu = Components.utils;
    10 const Cr = Components.results;
    12 Cu.import("resource:///modules/tabview/utils.jsm");
    13 Cu.import("resource://gre/modules/Services.jsm");
    14 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
    16 XPCOMUtils.defineLazyGetter(this, "tabviewBundle", function() {
    17   return Services.strings.
    18     createBundle("chrome://browser/locale/tabview.properties");
    19 });
    20 XPCOMUtils.defineLazyGetter(this, "tabbrowserBundle", function() {
    21   return Services.strings.
    22     createBundle("chrome://browser/locale/tabbrowser.properties");
    23 });
    25 function tabviewString(name) tabviewBundle.GetStringFromName('tabview.' + name);
    26 function tabbrowserString(name) tabbrowserBundle.GetStringFromName(name);
    28 XPCOMUtils.defineLazyGetter(this, "gPrefBranch", function() {
    29   return Services.prefs.getBranch("browser.panorama.");
    30 });
    32 XPCOMUtils.defineLazyModuleGetter(this, "gPageThumbnails",
    33   "resource://gre/modules/PageThumbs.jsm", "PageThumbs");
    35 var gWindow = window.parent;
    36 var gBrowser = gWindow.gBrowser;
    37 var gTabView = gWindow.TabView;
    38 var gTabViewDeck = gWindow.document.getElementById("tab-view-deck");
    39 var gBrowserPanel = gWindow.document.getElementById("browser-panel");
    40 var gTabViewFrame = gWindow.document.getElementById("tab-view");
    42 let AllTabs = {
    43   _events: {
    44     attrModified: "TabAttrModified",
    45     close:        "TabClose",
    46     move:         "TabMove",
    47     open:         "TabOpen",
    48     select:       "TabSelect",
    49     pinned:       "TabPinned",
    50     unpinned:     "TabUnpinned"
    51   },
    53   get tabs() {
    54     return Array.filter(gBrowser.tabs, function (tab) Utils.isValidXULTab(tab));
    55   },
    57   register: function AllTabs_register(eventName, callback) {
    58     gBrowser.tabContainer.addEventListener(this._events[eventName], callback, false);
    59   },
    61   unregister: function AllTabs_unregister(eventName, callback) {
    62     gBrowser.tabContainer.removeEventListener(this._events[eventName], callback, false);
    63   }
    64 };
    66 # NB: Certain files need to evaluate before others
    68 #include iq.js
    69 #include storage.js
    70 #include items.js
    71 #include groupitems.js
    72 #include tabitems.js
    73 #include favicons.js
    74 #include drag.js
    75 #include trench.js
    76 #include search.js
    77 #include telemetry.js
    78 #include ui.js

mercurial