browser/base/content/newtab/newTab.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/newtab/newTab.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +"use strict";
     1.9 +
    1.10 +let Cu = Components.utils;
    1.11 +let Ci = Components.interfaces;
    1.12 +
    1.13 +Cu.import("resource://gre/modules/XPCOMUtils.jsm");
    1.14 +Cu.import("resource://gre/modules/Services.jsm");
    1.15 +Cu.import("resource://gre/modules/PageThumbs.jsm");
    1.16 +Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm");
    1.17 +Cu.import("resource://gre/modules/DirectoryLinksProvider.jsm");
    1.18 +Cu.import("resource://gre/modules/NewTabUtils.jsm");
    1.19 +Cu.import("resource://gre/modules/Promise.jsm");
    1.20 +
    1.21 +XPCOMUtils.defineLazyModuleGetter(this, "Rect",
    1.22 +  "resource://gre/modules/Geometry.jsm");
    1.23 +XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
    1.24 +  "resource://gre/modules/PrivateBrowsingUtils.jsm");
    1.25 +XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
    1.26 +  "resource://gre/modules/UpdateChannel.jsm");
    1.27 +
    1.28 +let {
    1.29 +  links: gLinks,
    1.30 +  allPages: gAllPages,
    1.31 +  linkChecker: gLinkChecker,
    1.32 +  pinnedLinks: gPinnedLinks,
    1.33 +  blockedLinks: gBlockedLinks,
    1.34 +  gridPrefs: gGridPrefs
    1.35 +} = NewTabUtils;
    1.36 +
    1.37 +XPCOMUtils.defineLazyGetter(this, "gStringBundle", function() {
    1.38 +  return Services.strings.
    1.39 +    createBundle("chrome://browser/locale/newTab.properties");
    1.40 +});
    1.41 +
    1.42 +function newTabString(name) gStringBundle.GetStringFromName('newtab.' + name);
    1.43 +
    1.44 +function inPrivateBrowsingMode() {
    1.45 +  return PrivateBrowsingUtils.isWindowPrivate(window);
    1.46 +}
    1.47 +
    1.48 +const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
    1.49 +const XUL_NAMESPACE = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    1.50 +
    1.51 +#include transformations.js
    1.52 +#include page.js
    1.53 +#include grid.js
    1.54 +#include cells.js
    1.55 +#include sites.js
    1.56 +#include drag.js
    1.57 +#include dragDataHelper.js
    1.58 +#include drop.js
    1.59 +#include dropTargetShim.js
    1.60 +#include dropPreview.js
    1.61 +#include updater.js
    1.62 +#include undo.js
    1.63 +#include search.js
    1.64 +
    1.65 +// Everything is loaded. Initialize the New Tab Page.
    1.66 +gPage.init();

mercurial