Chromium Code Reviews| 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..c444e9b3b4ca3ceee26d7703e88368b58cf9791b 100644 |
| --- a/chrome/browser/extensions/crx_installer.cc |
| +++ b/chrome/browser/extensions/crx_installer.cc |
| @@ -51,6 +51,10 @@ |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/base/resource/resource_bundle.h" |
| +#if defined(OS_WIN) |
| +#include "chrome/browser/extensions/app_host_installer_win.h" |
| +#endif |
| + |
| using content::BrowserThread; |
| using content::UserMetricsAction; |
| @@ -508,7 +512,26 @@ void CrxInstaller::CompleteInstall() { |
| return; |
| } |
| } |
| +#if defined(OS_WIN) |
|
benwells
2012/10/03 05:08:43
This part of the codebase is platform independent.
huangs
2012/10/03 20:09:47
Done.
|
| + if (extension_->is_platform_app()) { |
| + // Ensures that App Host is present. |
| + // Will call CompleteExtensionInstall() after. |
| + // TODO(huangs): Should this be Unretained, or not? |
| + app_host_installer_.EnsureAppHostPresentAndCall( |
| + base::Bind(&CrxInstaller::CompleteExtensionInstall, |
| + base::Unretained(this)), |
| + base::Bind(&CrxInstaller::OnAppHostInstallFailure, |
| + base::Unretained(this))); |
| + } else { |
| + CompleteExtensionInstall(); |
| + } |
| +#else |
| + CompleteExtensionInstall(); |
| +#endif |
| +} |
| + |
| +void CrxInstaller::CompleteExtensionInstall() { |
| // See how long extension install paths are. This is important on |
| // windows, because file operations may fail if the path to a file |
| // exceeds a small constant. See crbug.com/69693 . |
| @@ -553,6 +576,13 @@ void CrxInstaller::CompleteInstall() { |
| } |
| +#if defined(OS_WIN) |
| +void CrxInstaller::OnAppHostInstallFailure() { |
| + string16 error = L"Some random error message"; |
|
benwells
2012/10/03 05:08:43
Ah, you did say work in progress....
huangs
2012/10/03 20:09:47
Yup. I moved this routine.
|
| + ReportFailureFromFileThread(CrxInstallerError(error)); |
| +} |
| +#endif |
| + |
| void CrxInstaller::ReportFailureFromFileThread(const CrxInstallerError& error) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| if (!BrowserThread::PostTask( |