browser/base/content/newtab/newTab.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 file,
     3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 "use strict";
     7 let Cu = Components.utils;
     8 let Ci = Components.interfaces;
    10 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
    11 Cu.import("resource://gre/modules/Services.jsm");
    12 Cu.import("resource://gre/modules/PageThumbs.jsm");
    13 Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm");
    14 Cu.import("resource://gre/modules/DirectoryLinksProvider.jsm");
    15 Cu.import("resource://gre/modules/NewTabUtils.jsm");
    16 Cu.import("resource://gre/modules/Promise.jsm");
    18 XPCOMUtils.defineLazyModuleGetter(this, "Rect",
    19   "resource://gre/modules/Geometry.jsm");
    20 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
    21   "resource://gre/modules/PrivateBrowsingUtils.jsm");
    22 XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
    23   "resource://gre/modules/UpdateChannel.jsm");
    25 let {
    26   links: gLinks,
    27   allPages: gAllPages,
    28   linkChecker: gLinkChecker,
    29   pinnedLinks: gPinnedLinks,
    30   blockedLinks: gBlockedLinks,
    31   gridPrefs: gGridPrefs
    32 } = NewTabUtils;
    34 XPCOMUtils.defineLazyGetter(this, "gStringBundle", function() {
    35   return Services.strings.
    36     createBundle("chrome://browser/locale/newTab.properties");
    37 });
    39 function newTabString(name) gStringBundle.GetStringFromName('newtab.' + name);
    41 function inPrivateBrowsingMode() {
    42   return PrivateBrowsingUtils.isWindowPrivate(window);
    43 }
    45 const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
    46 const XUL_NAMESPACE = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    48 #include transformations.js
    49 #include page.js
    50 #include grid.js
    51 #include cells.js
    52 #include sites.js
    53 #include drag.js
    54 #include dragDataHelper.js
    55 #include drop.js
    56 #include dropTargetShim.js
    57 #include dropPreview.js
    58 #include updater.js
    59 #include undo.js
    60 #include search.js
    62 // Everything is loaded. Initialize the New Tab Page.
    63 gPage.init();

mercurial