Bug 887755 - Lightweight theme preview is broken. r=margaret, a=lmandel
authorMark Finkle <mfinkle@mozilla.com>
Wed, 10 Sep 2014 22:09:09 -0400
changeset 217493 60c967fb8311fad437f5cf9907391dbed5cde0ec
parent 217492 cc4c10c8580d3e8ec70292237661f18fb810c96f
child 217494 10ddaad98dfef14bf10fde64a7c4f7f19ca477bd
push id6839
push userryanvm@gmail.com
push dateMon, 15 Sep 2014 14:35:33 +0000
treeherdermozilla-aurora@2697f51cfe95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, lmandel
bugs887755
milestone34.0a2
Bug 887755 - Lightweight theme preview is broken. r=margaret, a=lmandel
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -84,16 +84,19 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/WebappManager.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
                                   "resource://gre/modules/CharsetMenu.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetErrorHelper",
                                   "resource://gre/modules/NetErrorHelper.jsm");
 
+XPCOMUtils.defineLazyModuleGetter(this, "PermissionsUtils",
+                                  "resource://gre/modules/PermissionsUtils.jsm");
+
 // Lazily-loaded browser scripts:
 [
   ["SelectHelper", "chrome://browser/content/SelectHelper.js"],
   ["InputWidgetHelper", "chrome://browser/content/InputWidgetHelper.js"],
   ["AboutReader", "chrome://browser/content/aboutReader.js"],
   ["MasterPassword", "chrome://browser/content/MasterPassword.js"],
   ["PluginHelper", "chrome://browser/content/PluginHelper.js"],
   ["OfflineApps", "chrome://browser/content/OfflineApps.js"],
@@ -2835,16 +2838,19 @@ var LightWeightThemeWebInstaller = {
     this._previewWindow.removeEventListener("pagehide", this, true);
     this._previewWindow = null;
     BrowserApp.deck.removeEventListener("TabSelect", this, false);
 
     this._manager.resetPreview();
   },
 
   _isAllowed: function (node) {
+    // Make sure the whitelist has been imported to permissions
+    PermissionsUtils.importFromPrefs("xpinstall.", "install");
+
     let pm = Services.perms;
 
     let uri = node.ownerDocument.documentURIObject;
     return pm.testPermission(uri, "install") == pm.ALLOW_ACTION;
   },
 
   _getThemeFromNode: function (node) {
     return this._manager.parseTheme(node.getAttribute("data-browsertheme"), node.baseURI);