mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-09 13:25:00 +00:00
Bug 392812: Restart button remains disabled after extension updates. r=robstrong
This commit is contained in:
parent
466ff48127
commit
af532bd69f
@ -817,6 +817,7 @@ XPInstallDownloadManager.prototype = {
|
||||
}
|
||||
|
||||
gExtensionManager.addDownloads(items, items.length, false);
|
||||
updateOptionalViews();
|
||||
updateGlobalCommands();
|
||||
},
|
||||
|
||||
@ -833,15 +834,8 @@ XPInstallDownloadManager.prototype = {
|
||||
onStateChange: function (aAddon, aState, aValue)
|
||||
{
|
||||
const nsIXPIProgressDialog = Components.interfaces.nsIXPIProgressDialog;
|
||||
var element = this.getElementForAddon(aAddon);
|
||||
if (!element && aState != nsIXPIProgressDialog.DIALOG_CLOSE)
|
||||
return;
|
||||
switch (aState) {
|
||||
case nsIXPIProgressDialog.DOWNLOAD_START:
|
||||
gInstallCount++;
|
||||
if (gInstallCount == 1)
|
||||
updateGlobalCommands();
|
||||
break;
|
||||
case nsIXPIProgressDialog.DOWNLOAD_DONE:
|
||||
case nsIXPIProgressDialog.INSTALL_START:
|
||||
break;
|
||||
@ -1455,6 +1449,7 @@ function updateOptionalViews() {
|
||||
var showLocales = false;
|
||||
var showUpdates = false;
|
||||
var showInstalls = false;
|
||||
gInstallCount = 0;
|
||||
while (elements.hasMoreElements()) {
|
||||
var e = elements.getNext().QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if (!showLocales) {
|
||||
@ -1570,6 +1565,7 @@ function installUpdatesAll() {
|
||||
showView("installs");
|
||||
// Remove the updates view if there are no add-ons left to update
|
||||
updateOptionalViews();
|
||||
updateGlobalCommands();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1845,9 +1841,9 @@ var gExtensionsViewController = {
|
||||
showView("installs");
|
||||
var item = gExtensionManager.getItemForID(getIDFromResourceURI(aSelectedItem.id));
|
||||
gExtensionManager.addDownloads([item], 1, true);
|
||||
updateGlobalCommands();
|
||||
// Remove the updates view if there are no add-ons left to update
|
||||
updateOptionalViews();
|
||||
updateGlobalCommands();
|
||||
},
|
||||
|
||||
cmd_includeUpdate: function (aSelectedItem)
|
||||
|
@ -5384,7 +5384,6 @@ ExtensionManager.prototype = {
|
||||
|
||||
var txnID = Math.round(Math.random() * 100);
|
||||
txn.addDownload(currItem, txnID);
|
||||
this._transactions.push(txn);
|
||||
urls.push(currItem.xpiURL);
|
||||
hashes.push(currItem.xpiHash ? currItem.xpiHash : null);
|
||||
// if this is an update remove the update metadata to prevent it from
|
||||
@ -5400,6 +5399,7 @@ ExtensionManager.prototype = {
|
||||
var id = fromChrome ? PREFIX_ITEM_URI + currItem.id : currItem.xpiURL;
|
||||
ds.updateDownloadState(id, "waiting");
|
||||
}
|
||||
this._transactions.push(txn);
|
||||
|
||||
if (fromChrome) {
|
||||
// Initiate an install from chrome
|
||||
@ -5485,7 +5485,6 @@ ExtensionManager.prototype = {
|
||||
for (var i = 0; i < this._transactions.length; ++i) {
|
||||
if (this._transactions[i].id == transaction.id) {
|
||||
this._transactions.splice(i, 1);
|
||||
delete transaction;
|
||||
// Remove the observers when all transactions have completed.
|
||||
if (this._transactions.length == 0) {
|
||||
gOS.removeObserver(this, "offline-requested");
|
||||
|
Loading…
Reference in New Issue
Block a user