Bug 632388 - Offer restart for addons enabled by compatability checks [r=mossop, a=blocking]
authorWes Johnston <wjohnston@mozilla.com>
Wed, 23 Feb 2011 10:05:13 -0800
changeset 67421 c98fad60f33b8b3d5646ea9fb8842ef34b12b9ed
parent 67420 de3d3f4c8a4b5461ee913a8d3114a79fd8e648da
child 67422 0a8791f5c439f6970bca03b8af133caad233c254
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)
reviewersmossop, blocking
bugs632388
Bug 632388 - Offer restart for addons enabled by compatability checks [r=mossop, a=blocking]
mobile/chrome/content/extensions.js
--- a/mobile/chrome/content/extensions.js
+++ b/mobile/chrome/content/extensions.js
@@ -768,19 +768,25 @@ var ExtensionsView = {
         let updateable = false;
         let statusMsg = null;
         switch (aData) {
           case "update":
             statusMsg = strings.formatStringFromName("addonUpdate.updating", [update.version], 1);
             updateable = true;
             break;
           case "compatibility":
-            statusMsg = strings.GetStringFromName("addonUpdate.compatibility");
             if (addon.pendingOperations & AddonManager.PENDING_INSTALL || addon.pendingOperations & AddonManager.PENDING_UPGRADE)
               updateable = true;
+
+            // A compatibility update may require a restart, but will not fire an install
+            if (addon.pendingOperations & AddonManager.PENDING_ENABLE &&
+                addon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_ENABLE) {
+              statusMsg = strings.GetStringFromName("addonUpdate.compatibility");
+              this.showRestart();
+            }
             break;
           case "error":
             statusMsg = strings.GetStringFromName("addonUpdate.error");
             break;
           case "no-update":
             // Ignore if no updated was found. Just let the message go blank.
             //statusMsg = strings.GetStringFromName("addonUpdate.noupdate");
             break;