Bug 605801 - No restart notification when installing add-ons from AMO [r=mfinkle]

This commit is contained in:
Wesley Johnston 2010-10-20 17:25:00 -04:00
parent 525a77d530
commit 1bad638104
2 changed files with 17 additions and 22 deletions

View File

@ -765,31 +765,26 @@ function AddonInstallListener() {
}
AddonInstallListener.prototype = {
_updating: false,
onInstallEnded: function(aInstall, aAddon) {
if (aInstall.existingAddon && (aInstall.existingAddon.pendingOperations & AddonManager.PENDING_UPGRADE))
ExtensionsView.showRestart("update");
else if (aAddon.pendingOperations & AddonManager.PENDING_INSTALL)
ExtensionsView.showRestart("normal");
let element = ExtensionsView.getElementForAddon(aAddon.id);
if (!element)
return;
this._updating = element.hasAttribute("updating");
if (aAddon.pendingOperations & AddonManager.PENDING_INSTALL)
ExtensionsView.showRestart(element.hasAttribute("updating") ? "update" : "normal");
this._showInstallCompleteAlert(true);
if (!ExtensionsView.visible)
return;
element.setAttribute("opType", "needs-restart");
element.setAttribute("status", "success");
// If we are updating an add-on, change the status
if (this._updating) {
let strings = Elements.browserBundle;
element.setAttribute("updateStatus", strings.getFormattedString("addonUpdate.updated", [aAddon.version]));
element.removeAttribute("updating");
if (element) {
element.setAttribute("opType", "needs-restart");
element.setAttribute("status", "success");
// If we are updating an add-on, change the status
if (element.hasAttribute("updating")) {
let strings = Elements.browserBundle;
element.setAttribute("updateStatus", strings.getFormattedString("addonUpdate.updated", [aAddon.version]));
element.removeAttribute("updating");
}
}
this._showInstallCompleteAlert(true);
},
onInstallFailed: function(aInstall, aError) {

View File

@ -15,7 +15,7 @@
<em:minVersion>0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
<em:updateLink>http://example.com/browser/mobile/chrome/addons/browser_install1_3.xpi</em:updateLink>
<em:updateHash>sha1:8c4d2f5c9eadc8850558a9a9618aae25886dbe7c</em:updateHash>
<em:updateHash>sha1:f2d4b57686c60e237bcf19cd4ca8d2b65de04b07</em:updateHash>
</Description>
</em:targetApplication>
</Description>