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

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: Stylistic changes: typedef and function renames. 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 040e353d098d4a95f43a556f0f4e96a215968a18..c047cb6b39749eeb62df2f2350026fa23942b5a8 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -20,6 +20,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/extension_error_reporter.h"
@@ -463,7 +464,7 @@ void CrxInstaller::ConfirmInstall() {
} else {
if (!BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- base::Bind(&CrxInstaller::CompleteInstall, this)))
+ base::Bind(&CrxInstaller::BeginInstall, this)))
NOTREACHED();
}
return;
@@ -472,7 +473,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().
@@ -500,9 +501,8 @@ 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()) {
Version current_version(current_version_);
if (current_version.CompareTo(*(extension_->version())) > 0) {
@@ -515,6 +515,24 @@ void CrxInstaller::CompleteInstall() {
}
}
+ app_host_installer::InstallAppHostIfNecessary(
Aaron Boodman 2012/10/25 04:39:41 This seems out of place and like a layering violat
erikwright (departed) 2012/10/26 20:32:30 OK. It would be an API similar to the following:
Aaron Boodman 2012/10/29 23:37:29 Imagine a world after: mv /chrome/browser/extensi
+ *extension_,
+ base::Bind(&CrxInstaller::OnAppHostInstallationComplete, this));
Aaron Boodman 2012/10/25 04:39:41 I didn't have time to read all the code behind Ins
erikwright (departed) 2012/10/26 20:32:30 We launch an external process, which can take an a
Aaron Boodman 2012/10/29 23:37:29 You could move CrxInstaller to use the BlockingTas
huangs 2012/11/01 22:55:48 Per our discussion, moving installation to AppShor
+}
+
+void CrxInstaller::OnAppHostInstallationComplete(bool success) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ if (!success) {
+ ReportFailureFromFileThread(CrxInstallerError(
+ l10n_util::GetStringUTF16(IDS_EXTENSION_APP_HOST_INSTALL_ERROR)));
+ return;
+ }
+
+ CompleteInstall();
+}
+
+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
// exceeds a small constant. See crbug.com/69693 .

Powered by Google App Engine
This is Rietveld 408576698