Bug 854126 - Enable lightweight themes in private windows;r=dao
authorBrian Grinstead <bgrinstead@mozilla.com>
Tue, 17 Jan 2017 09:23:29 -0800
changeset 374859 c3f99c3904f15e6eddef13d3427c820a3fee54e1
parent 374858 93ffc3c44ee31192f6080f37d82994ca348e4148
child 374860 5b6e3ddaa0894dccf93c381eae4d83b74f29818e
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs854126
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 854126 - Enable lightweight themes in private windows;r=dao MozReview-Commit-ID: D8nZY6lzgNV
toolkit/modules/LightweightThemeConsumer.jsm
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -8,30 +8,22 @@ const {utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/AppConstants.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
   "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
-  "resource://gre/modules/PrivateBrowsingUtils.jsm");
-
 this.LightweightThemeConsumer =
  function LightweightThemeConsumer(aDocument) {
   this._doc = aDocument;
   this._win = aDocument.defaultView;
   this._footerId = aDocument.documentElement.getAttribute("lightweightthemesfooter");
 
-  if (PrivateBrowsingUtils.isWindowPrivate(this._win) &&
-      !PrivateBrowsingUtils.permanentPrivateBrowsing) {
-    return;
-  }
-
   let screen = this._win.screen;
   this._lastScreenWidth = screen.width;
   this._lastScreenHeight = screen.height;
 
   Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
 
   var temp = {};
   Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
@@ -82,22 +74,19 @@ LightweightThemeConsumer.prototype = {
         return;
       this._update(this._lastData);
       Services.obs.notifyObservers(this._win, "lightweight-theme-optimized",
                                    JSON.stringify(this._lastData));
     }
   },
 
   destroy() {
-    if (!PrivateBrowsingUtils.isWindowPrivate(this._win) ||
-        PrivateBrowsingUtils.permanentPrivateBrowsing) {
-      Services.obs.removeObserver(this, "lightweight-theme-styling-update");
+    Services.obs.removeObserver(this, "lightweight-theme-styling-update");
 
-      this._win.removeEventListener("resize", this);
-    }
+    this._win.removeEventListener("resize", this);
 
     this._win = this._doc = null;
   },
 
   _update(aData) {
     if (!aData) {
       aData = { headerURL: "", footerURL: "", textcolor: "", accentcolor: "" };
       this._lastData = aData;