Bug 1300808 - Only load options pages on Android for OPTIONS_TYPE_INLINE. r=kmag
authorMatthew Wein <mwein@mozilla.com>
Wed, 14 Sep 2016 13:59:40 -0700
changeset 357629 e3646efc3a07248c0bb02aa07437a8b469ae0576
parent 357628 5b40e209b9a751a03c3c9691893f5be954b0dc4e
child 357630 814b84f92b6033a7e66da871aaccfee18b55cc42
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1300808
milestone51.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 1300808 - Only load options pages on Android for OPTIONS_TYPE_INLINE. r=kmag MozReview-Commit-ID: DF739YRjxOb
mobile/android/chrome/content/aboutAddons.js
--- a/mobile/android/chrome/content/aboutAddons.js
+++ b/mobile/android/chrome/content/aboutAddons.js
@@ -80,22 +80,22 @@ var ContextMenus = {
       document.getElementById("contextmenu-disable").setAttribute("hidden", "true");
     }
   },
 
   enable: function(event) {
     Addons.setEnabled(true, this.target.addon);
     this.target = null;
   },
-  
+
   disable: function (event) {
     Addons.setEnabled(false, this.target.addon);
     this.target = null;
   },
-  
+
   uninstall: function (event) {
     Addons.uninstall(this.target.addon);
     this.target = null;
   }
 }
 
 function init() {
   window.addEventListener("popstate", onPopState, false);
@@ -220,16 +220,26 @@ var Addons = {
   },
 
   _createItemForAddon: function _createItemForAddon(aAddon) {
     let appManaged = (aAddon.scope == AddonManager.SCOPE_APPLICATION);
     let opType = this._getOpTypeForOperations(aAddon.pendingOperations);
     let updateable = (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE) > 0;
     let uninstallable = (aAddon.permissions & AddonManager.PERM_CAN_UNINSTALL) > 0;
 
+    // TODO(matt): Add support for OPTIONS_TYPE_INLINE_BROWSER once bug 1302504 lands.
+    let optionsURL;
+    switch (aAddon.optionsType) {
+      case AddonManager.OPTIONS_TYPE_INLINE:
+        optionsURL = aAddon.optionsURL || "";
+        break;
+      default:
+        optionsURL = "";
+    }
+
     let blocked = "";
     switch(aAddon.blocklistState) {
       case Ci.nsIBlocklistService.STATE_BLOCKED:
         blocked = "blocked";
         break;
       case Ci.nsIBlocklistService.STATE_SOFTBLOCKED:
         blocked = "softBlocked";
         break;
@@ -240,17 +250,17 @@ var Addons = {
 
     let item = this._createItem(aAddon);
     item.setAttribute("isDisabled", !aAddon.isActive);
     item.setAttribute("isUnsigned", aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING);
     item.setAttribute("opType", opType);
     item.setAttribute("updateable", updateable);
     if (blocked)
       item.setAttribute("blockedStatus", blocked);
-    item.setAttribute("optionsURL", aAddon.optionsURL || "");
+    item.setAttribute("optionsURL", optionsURL);
     item.addon = aAddon;
 
     return item;
   },
 
   _getElementForAddon: function(aKey) {
     let list = document.getElementById("addons-list");
     let element = list.querySelector("div[addonID=\"" + CSS.escape(aKey) + "\"]");