Bug 1093368 - Customize mode theme picker shouldn't pass the default theme object to LightweightThemeManager.previewTheme. r=jaws, a=lmandel
authorDão Gottwald <dao@mozilla.com>
Sat, 08 Nov 2014 20:30:00 +0100
changeset 226015 fa1706ebf845
parent 226014 f85f63d11f68
child 226016 252c3ab238d0
push id4105
push userryanvm@gmail.com
push date2014-11-10 18:36 +0000
treeherdermozilla-beta@fa1706ebf845 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, lmandel
bugs1093368
milestone34.0
Bug 1093368 - Customize mode theme picker shouldn't pass the default theme object to LightweightThemeManager.previewTheme. r=jaws, a=lmandel
browser/components/customizableui/CustomizeMode.jsm
toolkit/mozapps/extensions/LightweightThemeManager.jsm
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -1258,17 +1258,18 @@ CustomizeMode.prototype = {
     this.window.openUILinkIn(getMoreURL, "tab");
   },
 
   onLWThemesMenuShowing: function(aEvent) {
     const DEFAULT_THEME_ID = "{972ce4c6-7e08-4474-a285-3208198ce6fd}";
     const RECENT_LWT_COUNT = 5;
 
     function previewTheme(aEvent) {
-      LightweightThemeManager.previewTheme(aEvent.target.theme);
+      LightweightThemeManager.previewTheme(aEvent.target.theme.id != DEFAULT_THEME_ID ?
+                                           aEvent.target.theme : null);
     }
 
     function resetPreview() {
       LightweightThemeManager.resetPreview();
     }
 
     AddonManager.getAddonByID(DEFAULT_THEME_ID, function(aDefaultTheme) {
       let doc = this.window.document;
--- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm
+++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm
@@ -137,19 +137,16 @@ this.LightweightThemeManager = {
       AddonManagerPrivate.notifyAddonChanged(null, ADDON_TYPE, false);
     }
 
     _updateUsedThemes(_usedThemesExceptId(aId));
     AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper);
   },
 
   previewTheme: function LightweightThemeManager_previewTheme(aData) {
-    if (!aData)
-      return;
-
     let cancel = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
     cancel.data = false;
     Services.obs.notifyObservers(cancel, "lightweight-theme-preview-requested",
                                  JSON.stringify(aData));
     if (cancel.data)
       return;
 
     if (_previewTimer)