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

Unified Diff: chrome/browser/extensions/app_host/app_host_main.cc

Issue 10905238: If Chrome Binaries version > App Host version, then update App Host. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Including version info in app_hosts.exe; making GetChromePathForInstallationLevel() check Chrome in… Created 8 years, 3 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/app_host/app_host_main.cc
diff --git a/chrome/browser/extensions/app_host/app_host_main.cc b/chrome/browser/extensions/app_host/app_host_main.cc
index 10d044a57cbf93c2e524ceead7b669a8763e726d..ceb3dd8b3808afc09107914691da0fcad983ed71 100644
--- a/chrome/browser/extensions/app_host/app_host_main.cc
+++ b/chrome/browser/extensions/app_host/app_host_main.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/process_util.h"
#include "chrome/browser/extensions/app_host/binaries_installer.h"
+#include "chrome/browser/extensions/app_host/update.h"
#include "chrome/installer/launcher_support/chrome_launcher_support.h"
int main(int /* argc */, char* /* argv[] */) {
@@ -17,7 +18,6 @@ int main(int /* argc */, char* /* argv[] */) {
CommandLine::Init(0, NULL);
FilePath chrome_exe(chrome_launcher_support::GetAnyChromePath());
-
if (chrome_exe.empty()) {
LOG(INFO) << "No Chrome executable could be found. Let's install it.";
HRESULT hr = app_host::InstallBinaries();
@@ -37,14 +37,16 @@ int main(int /* argc */, char* /* argv[] */) {
CommandLine chrome_exe_command_line(chrome_exe);
chrome_exe_command_line.AppendArguments(
*CommandLine::ForCurrentProcess(), false);
-
- if (base::LaunchProcess(chrome_exe_command_line,
- base::LaunchOptions(),
- NULL)) {
+ // Launch Chrome before checking for update, for faster user experience.
+ bool launch_result = base::LaunchProcess(chrome_exe_command_line,
+ base::LaunchOptions(),
+ NULL);
+ if (launch_result)
LOG(INFO) << "Delegated to Chrome executable at " << chrome_exe.value();
- return 0;
- } else {
+ else
LOG(INFO) << "Failed to launch Chrome executable at " << chrome_exe.value();
- return 1;
- }
+
+ app_host::EnsureAppHostUpToDate();
+
+ return !launch_result;
}

Powered by Google App Engine
This is Rietveld 408576698