Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1156)

Unified Diff: chrome/browser/extensions/crx_installer.cc

Issue 11054006: Make application shortcuts point to app_host.exe, install App Host during app installation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698