|
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/. */ |
|
4 |
|
5 "use strict"; |
|
6 |
|
7 let Cu = Components.utils; |
|
8 let Ci = Components.interfaces; |
|
9 |
|
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"); |
|
17 |
|
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"); |
|
24 |
|
25 let { |
|
26 links: gLinks, |
|
27 allPages: gAllPages, |
|
28 linkChecker: gLinkChecker, |
|
29 pinnedLinks: gPinnedLinks, |
|
30 blockedLinks: gBlockedLinks, |
|
31 gridPrefs: gGridPrefs |
|
32 } = NewTabUtils; |
|
33 |
|
34 XPCOMUtils.defineLazyGetter(this, "gStringBundle", function() { |
|
35 return Services.strings. |
|
36 createBundle("chrome://browser/locale/newTab.properties"); |
|
37 }); |
|
38 |
|
39 function newTabString(name) gStringBundle.GetStringFromName('newtab.' + name); |
|
40 |
|
41 function inPrivateBrowsingMode() { |
|
42 return PrivateBrowsingUtils.isWindowPrivate(window); |
|
43 } |
|
44 |
|
45 const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; |
|
46 const XUL_NAMESPACE = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; |
|
47 |
|
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 |
|
61 |
|
62 // Everything is loaded. Initialize the New Tab Page. |
|
63 gPage.init(); |