Index: chrome/browser/extensions/crx_installer.cc |
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc |
index d1f2a77c1f21132033696985f1e761549670cf66..3b2390010bb7beb23351ca3f613fbbeb6d40cca3 100644 |
--- a/chrome/browser/extensions/crx_installer.cc |
+++ b/chrome/browser/extensions/crx_installer.cc |
@@ -21,6 +21,7 @@ |
#include "base/utf_string_conversions.h" |
#include "base/version.h" |
#include "chrome/browser/browser_process.h" |
+#include "chrome/browser/extensions/app_host_installer.h" |
#include "chrome/browser/extensions/convert_user_script.h" |
#include "chrome/browser/extensions/convert_web_app.h" |
#include "chrome/browser/extensions/default_apps_trial.h" |
@@ -457,7 +458,7 @@ void CrxInstaller::ConfirmInstall() { |
} else { |
if (!BrowserThread::PostTask( |
BrowserThread::FILE, FROM_HERE, |
- base::Bind(&CrxInstaller::CompleteInstall, this))) |
+ base::Bind(&CrxInstaller::BeginInstall, this))) |
NOTREACHED(); |
} |
return; |
@@ -466,7 +467,7 @@ void CrxInstaller::ConfirmInstall() { |
void CrxInstaller::InstallUIProceed() { |
if (!BrowserThread::PostTask( |
BrowserThread::FILE, FROM_HERE, |
- base::Bind(&CrxInstaller::CompleteInstall, this))) |
+ base::Bind(&CrxInstaller::BeginInstall, this))) |
NOTREACHED(); |
Release(); // balanced in ConfirmInstall(). |
@@ -494,7 +495,7 @@ void CrxInstaller::InstallUIAbort(bool user_initiated) { |
// should go to zero and we die. The destructor will clean up the temp dir. |
} |
-void CrxInstaller::CompleteInstall() { |
+void CrxInstaller::BeginInstall() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
if (!current_version_.empty()) { |
@@ -508,6 +509,26 @@ void CrxInstaller::CompleteInstall() { |
return; |
} |
} |
+ if (AppHostInstaller::IsAppHostInstallRequired(*extension_)) { |
+ app_host_installer_.InstallAppHost( |
+ base::Bind(&CrxInstaller::OnAppHostInstallation, this)); |
benwells
2012/10/04 07:53:01
early return here and remove the else
huangs
2012/10/04 22:56:42
Done.
|
+ } else { |
+ CompleteInstall(); |
+ } |
+} |
+ |
+void CrxInstaller::OnAppHostInstallation(bool success) { |
erikwright (departed)
2012/10/04 01:28:16
OnAppHostInstallationComplete
huangs
2012/10/04 22:56:42
Done.
|
+ if (success) { |
+ CompleteInstall(); |
benwells
2012/10/04 07:53:01
Early return and remove the else
huangs
2012/10/04 22:56:42
Done.
|
+ } else { |
+ // TODO(huangs): Error message. |
benwells
2012/10/04 07:53:01
I take it you'll remove this TODO / fix the error
huangs
2012/10/04 22:56:42
Done.
|
+ string16 error = L"Some random error message"; |
+ ReportFailureFromFileThread(CrxInstallerError(error)); |
+ } |
+} |
+ |
+void CrxInstaller::CompleteInstall() { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
// See how long extension install paths are. This is important on |
// windows, because file operations may fail if the path to a file |