Bug 580639 - Uninstall for disabled add-ons doesn't work. [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Thu, 22 Jul 2010 15:42:40 -0400
changeset 66386 cc42913918da92cfcdccd5a62fc1ac6402137c8a
parent 66385 3e18409102780411cf1e98a36282296da65c94d0
child 66387 74ece844d129d2c29062b24d231ca5182cf952a2
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs580639
Bug 580639 - Uninstall for disabled add-ons doesn't work. [r=mfinkle]
mobile/chrome/content/browser.css
mobile/chrome/content/extensions.js
--- a/mobile/chrome/content/browser.css
+++ b/mobile/chrome/content/browser.css
@@ -188,16 +188,17 @@ richlistitem[opType="needs-install"] .sh
 richlistitem[opType="needs-enable"] .show-on-enable,
 richlistitem[opType="needs-disable"] .show-on-disable,
 richlistitem[isDisabled="true"] .show-on-disable {
   display: -moz-box;
 }
 
 richlistitem[opType="needs-restart"] .hide-on-restart,
 richlistitem[opType="needs-uninstall"] .hide-on-uninstall,
+richlistitem[isDisabled="true"][opType="needs-uninstall"],
 richlistitem[opType="needs-install"] .hide-on-install,
 richlistitem[opType="needs-enable"] .hide-on-enable,
 richlistitem[opType="needs-disable"] .hide-on-disable {
   display: none;
 }
 
 richlistitem[type="error"],
 richlistitem[type="warning"] {
--- a/mobile/chrome/content/extensions.js
+++ b/mobile/chrome/content/extensions.js
@@ -66,17 +66,17 @@ var ExtensionsView = {
     if (aOperations & AddonManager.PENDING_UNINSTALL)
       return "needs-uninstall";
     if (aOperations & AddonManager.PENDING_ENABLE)
       return "needs-enable";
     if (aOperations & AddonManager.PENDING_DISABLE)
       return "needs-disable";
     return "";
   },
-  
+
   _createItem: function ev__createItem(aAddon, aTypeName) {
     let item = document.createElement("richlistitem");
     item.setAttribute("id", PREFIX_ITEM_URI + aAddon.id);
     item.setAttribute("addonID", aAddon.id);
     item.setAttribute("typeName", aTypeName);
     item.setAttribute("type", aAddon.type);
     item.setAttribute("typeLabel", this._strings["addonType." + aAddon.type]);
     item.setAttribute("name", aAddon.name);
@@ -381,16 +381,22 @@ var ExtensionsView = {
       // the search-engine-modified observer in browser.js will take care of
       // updating the list
     } else {
       aItem.addon.uninstall();
       opType = this._getOpTypeForOperations(aItem.addon.pendingOperations);
 
       if (opType == "needs-uninstall")
         this.showRestart();
+
+      // A disabled addon doesn't need a restart so it has no pending ops and
+      // can't be cancelled
+      if (!aItem.addon.isActive && opType == "")
+        opType = "needs-uninstall";
+
       aItem.setAttribute("opType", opType);
     }
   },
 
   cancelUninstall: function ev_cancelUninstall(aItem) {
     aItem.addon.cancelUninstall();
 
     this.hideRestart();