Bug 902932 - Cleaning up problematic dead code in aboutAddons.js r=liuche
authorChris Kitching <ckitching@mozilla.com>
Thu, 08 Aug 2013 18:51:27 -0700
changeset 141833 5446f1cddcaf484e4b665bb07221be94bc055ecb
parent 141832 0f21776e01b99b87877b1c24c30690cbc9b7548b
child 141834 e9e92ac3a89c732efb0f0e9461aa79751297629c
push id2107
push usercliu@mozilla.com
push dateFri, 09 Aug 2013 01:51:45 +0000
treeherderfx-team@5446f1cddcaf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche
bugs902932
milestone26.0a1
Bug 902932 - Cleaning up problematic dead code in aboutAddons.js r=liuche
mobile/android/chrome/content/aboutAddons.js
--- a/mobile/android/chrome/content/aboutAddons.js
+++ b/mobile/android/chrome/content/aboutAddons.js
@@ -36,17 +36,16 @@ var ContextMenus = {
     while (!this.target.hasAttribute("contextmenu")) {
       this.target = this.target.parentNode;
     }
 
     if (!this.target) {
       document.getElementById("contextmenu-enable").setAttribute("hidden", "true");
       document.getElementById("contextmenu-disable").setAttribute("hidden", "true");
       document.getElementById("contextmenu-uninstall").setAttribute("hidden", "true");
-      document.getElementById("contextmenu-default").setAttribute("hidden", "true");
       return;
     }
 
     let addon = this.target.addon;
     if (addon.scope == AddonManager.SCOPE_APPLICATION) {
       document.getElementById("contextmenu-uninstall").setAttribute("hidden", "true");
     } else {
       document.getElementById("contextmenu-uninstall").removeAttribute("hidden");
@@ -55,18 +54,16 @@ var ContextMenus = {
     let enabled = this.target.getAttribute("isDisabled") != "true";
     if (enabled) {
       document.getElementById("contextmenu-enable").setAttribute("hidden", "true");
       document.getElementById("contextmenu-disable").removeAttribute("hidden");
     } else {
       document.getElementById("contextmenu-enable").removeAttribute("hidden");
       document.getElementById("contextmenu-disable").setAttribute("hidden", "true");
     }
-
-    document.getElementById("contextmenu-default").setAttribute("hidden", "true");
   },
 
   enable: function(event) {
     Addons.setEnabled(true, this.target.addon);
     this.target = null;
   },
   
   disable: function (event) {
@@ -248,47 +245,16 @@ var Addons = {
       let list = document.getElementById("addons-list");
       list.innerHTML = "";
 
       for (let i=0; i<aAddons.length; i++) {
         let item = self._createItemForAddon(aAddons[i]);
         list.appendChild(item);
       }
 
-      // Load the search engines
-      let defaults = Services.search.getDefaultEngines({ }).map(function (e) e.name);
-      function isDefault(aEngine)
-        defaults.indexOf(aEngine.name) != -1
-
-      let defaultDescription = gStringBundle.GetStringFromName("addonsSearchEngine.description");
-
-      let engines = Services.search.getEngines({ });
-      for (let e = 0; e < engines.length; e++) {
-        let engine = engines[e];
-        let addon = {};
-        addon.id = engine.name;
-        addon.type = "search";
-        addon.name = engine.name;
-        addon.version = "";
-        addon.description = engine.description || defaultDescription;
-        addon.iconURL = engine.iconURI ? engine.iconURI.spec : "";
-        addon.optionsURL = "";
-        addon.appDisabled = false;
-        addon.scope = isDefault(engine) ? AddonManager.SCOPE_APPLICATION : AddonManager.SCOPE_PROFILE;
-        addon.engine = engine;
-
-        let item = self._createItem(addon);
-        item.setAttribute("isDisabled", engine.hidden);
-        item.setAttribute("updateable", "false");
-        item.setAttribute("opType", "");
-        item.setAttribute("optionsURL", "");
-        item.addon = addon;
-        list.appendChild(item);
-      }
-
       // Add a "Browse all Firefox Add-ons" item to the bottom of the list.
       let browseItem = self._createBrowseItem();
       list.appendChild(browseItem);
     });
   },
 
   _getOpTypeForOperations: function _getOpTypeForOperations(aOperations) {
     if (aOperations & AddonManager.PENDING_UNINSTALL)
@@ -343,19 +309,16 @@ var Addons = {
       enableBtn.removeAttribute("disabled");
 
     let uninstallBtn = document.getElementById("uninstall-btn");
     if (addon.scope == AddonManager.SCOPE_APPLICATION)
       uninstallBtn.setAttribute("disabled", "true");
     else
       uninstallBtn.removeAttribute("disabled");
 
-    let defaultButton = document.getElementById("default-btn");
-    defaultButton.setAttribute("hidden", "true");
-
     let box = document.querySelector("#addons-details > .addon-item .options-box");
     box.innerHTML = "";
 
     // Retrieve the extensions preferences
     try {
       let optionsURL = aListItem.getAttribute("optionsURL");
       let xhr = new XMLHttpRequest();
       xhr.open("GET", optionsURL, false);