Index: chrome/browser/extensions/crx_installer.cc |
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc |
index dd54f0637ba46f167bb5e360d560ebf2a5ef9c1e..77f3875652cf6d4a5ada5b68109632c526fc1513 100644 |
--- a/chrome/browser/extensions/crx_installer.cc |
+++ b/chrome/browser/extensions/crx_installer.cc |
@@ -485,7 +485,7 @@ void CrxInstaller::InstallUIAbort(bool user_initiated) { |
content::Source<CrxInstaller>(this), |
content::NotificationService::NoDetails()); |
- NotifyCrxInstallComplete(NULL); |
+ NotifyCrxInstallComplete(false); |
Release(); // balanced in ConfirmInstall(). |
@@ -581,7 +581,7 @@ void CrxInstaller::ReportFailureFromUIThread(const CrxInstallerError& error) { |
if (client_) |
client_->OnInstallFailure(error); |
- NotifyCrxInstallComplete(NULL); |
+ NotifyCrxInstallComplete(false); |
// Delete temporary files. |
CleanupTempFiles(); |
@@ -627,20 +627,15 @@ void CrxInstaller::ReportSuccessFromUIThread() { |
// Tell the frontend about the installation and hand off ownership of |
// extension_ to it. |
- frontend_weak_->OnExtensionInstalled(extension_, |
- page_ordinal_, |
- has_requirement_errors_, |
- install_wait_for_idle_); |
- |
- NotifyCrxInstallComplete(extension_.get()); |
- |
- extension_ = NULL; |
- |
- // We're done. We don't post any more tasks to ourselves so we are deleted |
- // soon. |
+ frontend_weak_->InstallExtensionAsync( |
+ extension_, |
+ page_ordinal_, |
+ has_requirement_errors_, |
+ install_wait_for_idle_, |
+ base::Bind(&CrxInstaller::NotifyCrxInstallComplete, this)); |
} |
-void CrxInstaller::NotifyCrxInstallComplete(const Extension* extension) { |
+void CrxInstaller::NotifyCrxInstallComplete(bool success) { |
// Some users (such as the download shelf) need to know when a |
// CRXInstaller is done. Listening for the EXTENSION_* events |
// is problematic because they don't know anything about the |
@@ -649,7 +644,11 @@ void CrxInstaller::NotifyCrxInstallComplete(const Extension* extension) { |
content::NotificationService::current()->Notify( |
chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
content::Source<CrxInstaller>(this), |
- content::Details<const Extension>(extension)); |
+ content::Details<const Extension>(success ? extension_.get() : NULL)); |
+ |
+ // We're done. We don't post any more tasks to ourselves so we are deleted |
+ // soon. |
+ extension_ = NULL; |
} |
void CrxInstaller::CleanupTempFiles() { |