summaryrefslogtreecommitdiffstats
path: root/toolkit/components/thumbnails
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/thumbnails')
-rw-r--r--toolkit/components/thumbnails/BackgroundPageThumbs.jsm43
-rw-r--r--toolkit/components/thumbnails/PageThumbs.jsm3
-rw-r--r--toolkit/components/thumbnails/moz.build4
3 files changed, 6 insertions, 44 deletions
diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
index 3eec9827d..3ed32665d 100644
--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
@@ -15,8 +15,6 @@ const TELEMETRY_HISTOGRAM_ID_PREFIX = "FX_THUMBNAILS_BG_";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const HTML_NS = "http://www.w3.org/1999/xhtml";
-const ABOUT_NEWTAB_SEGREGATION_PREF = "privacy.usercontext.about_newtab_segregation.enabled";
-
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
@@ -37,10 +35,11 @@ XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_TIMEOUT", TEL_CAPTURE_DONE_TIM
XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_CRASHED", TEL_CAPTURE_DONE_CRASHED);
XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_BAD_URI", TEL_CAPTURE_DONE_BAD_URI);
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
const global = this;
+// contains base64 version of a placeholder thumbnail
+#include blankthumb.inc
+
const BackgroundPageThumbs = {
/**
@@ -136,14 +135,6 @@ const BackgroundPageThumbs = {
}),
/**
- * Tell the service that the thumbnail browser should be recreated at next
- * call of _ensureBrowser().
- */
- renewThumbnailBrowser: function() {
- this._renewThumbBrowser = true;
- },
-
- /**
* Ensures that initialization of the thumbnail browser's parent window has
* begun.
*
@@ -198,12 +189,9 @@ const BackgroundPageThumbs = {
* Creates the thumbnail browser if it doesn't already exist.
*/
_ensureBrowser: function () {
- if (this._thumbBrowser && !this._renewThumbBrowser)
+ if (this._thumbBrowser)
return;
- this._destroyBrowser();
- this._renewThumbBrowser = false;
-
let browser = this._parentWin.document.createElementNS(XUL_NS, "browser");
browser.setAttribute("type", "content");
browser.setAttribute("disableglobalhistory", "true");
@@ -213,13 +201,6 @@ const BackgroundPageThumbs = {
browser.setAttribute("remote", "true");
}
- if (Services.prefs.getBoolPref(ABOUT_NEWTAB_SEGREGATION_PREF)) {
- // Use the private container for thumbnails.
- let privateIdentity =
- ContextualIdentityService.getPrivateIdentity("userContextIdInternal.thumbnail");
- browser.setAttribute("usercontextid", privateIdentity.userContextId);
- }
-
// Size the browser. Make its aspect ratio the same as the canvases' that
// the thumbnails are drawn into; the canvases' aspect ratio is the same as
// the screen's, so use that. Aim for a size in the ballpark of 1024x768.
@@ -322,14 +303,6 @@ const BackgroundPageThumbs = {
_destroyBrowserTimeout: DESTROY_BROWSER_TIMEOUT,
};
-Services.prefs.addObserver(ABOUT_NEWTAB_SEGREGATION_PREF,
- function(aSubject, aTopic, aData) {
- if (aTopic == "nsPref:changed" && aData == ABOUT_NEWTAB_SEGREGATION_PREF) {
- BackgroundPageThumbs.renewThumbnailBrowser();
- }
- },
- false);
-
Object.defineProperty(this, "BackgroundPageThumbs", {
value: BackgroundPageThumbs,
enumerable: true,
@@ -464,14 +437,6 @@ Capture.prototype = {
Cu.reportError(err);
}
}
-
- if (Services.prefs.getBoolPref(ABOUT_NEWTAB_SEGREGATION_PREF)) {
- // Clear the data in the private container for thumbnails.
- let privateIdentity =
- ContextualIdentityService.getPrivateIdentity("userContextIdInternal.thumbnail");
- Services.obs.notifyObservers(null, "clear-origin-attributes-data",
- JSON.stringify({ userContextId: privateIdentity.userContextId }));
- }
};
if (!data) {
diff --git a/toolkit/components/thumbnails/PageThumbs.jsm b/toolkit/components/thumbnails/PageThumbs.jsm
index 5c7754b31..b0affee92 100644
--- a/toolkit/components/thumbnails/PageThumbs.jsm
+++ b/toolkit/components/thumbnails/PageThumbs.jsm
@@ -28,9 +28,6 @@ const MAX_THUMBNAIL_AGE_SECS = 172800; // 2 days == 60*60*24*2 == 172800 secs.
*/
const THUMBNAIL_DIRECTORY = "thumbnails";
-// contains base64 version of a placeholder thumbnail
-#include blankthumb.inc
-
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
Cu.import("resource://gre/modules/PromiseWorker.jsm", this);
Cu.import("resource://gre/modules/Promise.jsm", this);
diff --git a/toolkit/components/thumbnails/moz.build b/toolkit/components/thumbnails/moz.build
index d4003c635..e4a178998 100644
--- a/toolkit/components/thumbnails/moz.build
+++ b/toolkit/components/thumbnails/moz.build
@@ -13,13 +13,13 @@ EXTRA_COMPONENTS += [
]
EXTRA_JS_MODULES += [
- 'BackgroundPageThumbs.jsm',
+ 'PageThumbs.jsm',
'PageThumbsWorker.js',
'PageThumbUtils.jsm',
]
EXTRA_PP_JS_MODULES += [
- 'PageThumbs.jsm',
+ 'BackgroundPageThumbs.jsm',
]