2012-01-25 14:40:18 -08:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
let Cu = Components.utils;
|
|
|
|
let Ci = Components.interfaces;
|
|
|
|
|
|
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
2013-02-16 20:15:41 -08:00
|
|
|
Cu.import("resource://gre/modules/PageThumbs.jsm");
|
2013-09-09 19:58:57 -07:00
|
|
|
Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm");
|
2014-03-31 01:51:22 -07:00
|
|
|
Cu.import("resource://gre/modules/DirectoryLinksProvider.jsm");
|
2013-02-16 20:16:16 -08:00
|
|
|
Cu.import("resource://gre/modules/NewTabUtils.jsm");
|
2014-04-09 02:43:11 -07:00
|
|
|
Cu.import("resource://gre/modules/Promise.jsm");
|
2012-01-25 14:40:18 -08:00
|
|
|
|
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "Rect",
|
|
|
|
"resource://gre/modules/Geometry.jsm");
|
2012-10-05 16:25:52 -07:00
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
|
|
|
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
2014-04-26 13:39:58 -07:00
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
|
|
|
|
"resource://gre/modules/UpdateChannel.jsm");
|
2012-01-25 14:40:18 -08:00
|
|
|
|
|
|
|
let {
|
|
|
|
links: gLinks,
|
|
|
|
allPages: gAllPages,
|
2012-07-16 15:35:13 -07:00
|
|
|
linkChecker: gLinkChecker,
|
2012-01-25 14:40:18 -08:00
|
|
|
pinnedLinks: gPinnedLinks,
|
2012-08-16 22:01:03 -07:00
|
|
|
blockedLinks: gBlockedLinks,
|
|
|
|
gridPrefs: gGridPrefs
|
2012-01-25 14:40:18 -08:00
|
|
|
} = NewTabUtils;
|
|
|
|
|
|
|
|
XPCOMUtils.defineLazyGetter(this, "gStringBundle", function() {
|
|
|
|
return Services.strings.
|
|
|
|
createBundle("chrome://browser/locale/newTab.properties");
|
|
|
|
});
|
|
|
|
|
|
|
|
function newTabString(name) gStringBundle.GetStringFromName('newtab.' + name);
|
|
|
|
|
2012-07-09 15:35:30 -07:00
|
|
|
function inPrivateBrowsingMode() {
|
2012-10-05 16:25:52 -07:00
|
|
|
return PrivateBrowsingUtils.isWindowPrivate(window);
|
2012-07-09 15:35:30 -07:00
|
|
|
}
|
|
|
|
|
2012-01-25 14:40:18 -08:00
|
|
|
const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
2014-04-24 19:09:23 -07:00
|
|
|
const XUL_NAMESPACE = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
2012-01-25 14:40:18 -08:00
|
|
|
|
|
|
|
#include transformations.js
|
|
|
|
#include page.js
|
|
|
|
#include grid.js
|
|
|
|
#include cells.js
|
|
|
|
#include sites.js
|
|
|
|
#include drag.js
|
2012-07-16 15:35:13 -07:00
|
|
|
#include dragDataHelper.js
|
2012-01-25 14:40:18 -08:00
|
|
|
#include drop.js
|
|
|
|
#include dropTargetShim.js
|
|
|
|
#include dropPreview.js
|
|
|
|
#include updater.js
|
2012-08-23 15:34:52 -07:00
|
|
|
#include undo.js
|
2014-04-24 19:09:23 -07:00
|
|
|
#include search.js
|
2012-02-03 01:41:09 -08:00
|
|
|
|
|
|
|
// Everything is loaded. Initialize the New Tab Page.
|
2012-03-12 19:23:01 -07:00
|
|
|
gPage.init();
|