Permalink
Browse files

Clean up checking for updates of scripts.

Especially: the missing callInstallListeners('onNewInstall') broke bits of the UI, in the non-"Update Add-ons Automatically" case.
  • Loading branch information...
1 parent 0ce5992 commit 8fe0d4a9870676a4625c5732ec9cc6268b9199b0 @arantius arantius committed Oct 17, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 modules/addons4.js
View
@@ -202,18 +202,20 @@ ScriptAddon.prototype._handleRemoteUpdate = function(
try {
if (aAvailable) {
var scriptInstall = ScriptInstallFactoryByAddon(this);
+ AddonManagerPrivate.callInstallListeners(
+ 'onNewInstall', [], scriptInstall);
tryToCall(aUpdateListener, 'onUpdateAvailable', this, scriptInstall);
} else {
tryToCall(aUpdateListener, 'onNoUpdateAvailable', this);
}
- if ('undefined' != typeof aUpdateListener.onUpdateFinished) {
- tryToCall(aUpdateListener, 'onUpdateFinished', this, 0);
- }
+ tryToCall(aUpdateListener, 'onUpdateFinished', this,
+ AddonManager.UPDATE_STATUS_NO_ERROR);
} catch (e) {
// See #1621. Don't die if (e.g.) an addon listener doesn't provide
// the entire interface and thus a method is undefined.
Components.utils.reportError(e);
- tryToCall(aUpdateListener, 'onUpdateFinished', this, 1);
+ tryToCall(aUpdateListener, 'onUpdateFinished', this,
+ AddonManager.UPDATE_STATUS_DOWNLOAD_ERROR);
}
};

0 comments on commit 8fe0d4a

Please sign in to comment.