michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: let Cu = Components.utils; michael@0: let Ci = Components.interfaces; michael@0: michael@0: Cu.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: Cu.import("resource://gre/modules/Services.jsm"); michael@0: Cu.import("resource://gre/modules/PageThumbs.jsm"); michael@0: Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm"); michael@0: Cu.import("resource://gre/modules/DirectoryLinksProvider.jsm"); michael@0: Cu.import("resource://gre/modules/NewTabUtils.jsm"); michael@0: Cu.import("resource://gre/modules/Promise.jsm"); michael@0: michael@0: XPCOMUtils.defineLazyModuleGetter(this, "Rect", michael@0: "resource://gre/modules/Geometry.jsm"); michael@0: XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", michael@0: "resource://gre/modules/PrivateBrowsingUtils.jsm"); michael@0: XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel", michael@0: "resource://gre/modules/UpdateChannel.jsm"); michael@0: michael@0: let { michael@0: links: gLinks, michael@0: allPages: gAllPages, michael@0: linkChecker: gLinkChecker, michael@0: pinnedLinks: gPinnedLinks, michael@0: blockedLinks: gBlockedLinks, michael@0: gridPrefs: gGridPrefs michael@0: } = NewTabUtils; michael@0: michael@0: XPCOMUtils.defineLazyGetter(this, "gStringBundle", function() { michael@0: return Services.strings. michael@0: createBundle("chrome://browser/locale/newTab.properties"); michael@0: }); michael@0: michael@0: function newTabString(name) gStringBundle.GetStringFromName('newtab.' + name); michael@0: michael@0: function inPrivateBrowsingMode() { michael@0: return PrivateBrowsingUtils.isWindowPrivate(window); michael@0: } michael@0: michael@0: const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; michael@0: const XUL_NAMESPACE = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; michael@0: michael@0: #include transformations.js michael@0: #include page.js michael@0: #include grid.js michael@0: #include cells.js michael@0: #include sites.js michael@0: #include drag.js michael@0: #include dragDataHelper.js michael@0: #include drop.js michael@0: #include dropTargetShim.js michael@0: #include dropPreview.js michael@0: #include updater.js michael@0: #include undo.js michael@0: #include search.js michael@0: michael@0: // Everything is loaded. Initialize the New Tab Page. michael@0: gPage.init();