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 216729 c21b3ccb9c19
parent 216728 275330447f6d
child 216730 9148cd599e9f
push id3892
push userryanvm@gmail.com
push date2014-09-15 14:56 +0000
treeherdermozilla-beta@cd04e5bf0fec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, lmandel
bugs887755
milestone33.0
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
@@ -81,16 +81,19 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 #endif
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebappManager",
                                   "resource://gre/modules/WebappManager.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
                                   "resource://gre/modules/CharsetMenu.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"],
@@ -2853,16 +2856,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);