Bug 852295 - Allow Lightweight Themes in Permanent Private Browsing. r=dao a=akeybl CALENDAR_2_3b1_BUILD1 CALENDAR_2_3b1_RELEASE
authorCykesiopka <cykesiopka@hotmail.com>
Fri, 29 Mar 2013 11:29:29 -0400
changeset 132586 1422a858262d3346393a611c31983f8e0887e0b5
parent 132583 e986afca566460ecf2efedcf98fbcc4811b29e89
child 132587 905be9f138e1f04c5442a14745dac83fee108991
child 132589 e9116e0abdd6f2090f9fde7061cd38cb47141bf1
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersdao, akeybl
bugs852295
milestone21.0
Bug 852295 - Allow Lightweight Themes in Permanent Private Browsing. r=dao a=akeybl
toolkit/content/LightweightThemeConsumer.jsm
--- a/toolkit/content/LightweightThemeConsumer.jsm
+++ b/toolkit/content/LightweightThemeConsumer.jsm
@@ -13,17 +13,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
   "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)) {
+  if (PrivateBrowsingUtils.isWindowPrivate(this._win) &&
+      !PrivateBrowsingUtils.permanentPrivateBrowsing) {
     return;
   }
 
   let screen = this._win.screen;
   this._lastScreenWidth = screen.width;
   this._lastScreenHeight = screen.height;
 
   Components.classes["@mozilla.org/observer-service;1"]
@@ -54,17 +55,18 @@ LightweightThemeConsumer.prototype = {
     if (this._lastScreenWidth != width || this._lastScreenHeight != height) {
       this._lastScreenWidth = width;
       this._lastScreenHeight = height;
       this._update(this._lastData);
     }
   },
 
   destroy: function () {
-    if (!PrivateBrowsingUtils.isWindowPrivate(this._win)) {
+    if (!PrivateBrowsingUtils.isWindowPrivate(this._win) ||
+        PrivateBrowsingUtils.permanentPrivateBrowsing) {
       Components.classes["@mozilla.org/observer-service;1"]
                 .getService(Components.interfaces.nsIObserverService)
                 .removeObserver(this, "lightweight-theme-styling-update");
 
       this._win.removeEventListener("resize", this);
     }
 
     this._win = this._doc = null;