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

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: Renamed app_host_upgrade.* to update.*; changed how App Host version is obtained; moved code to upd… 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..5802977f1c273ee1a2e5c63f34ae1cc7118a6e1d 100644
--- a/chrome/browser/extensions/app_host/app_host_main.cc
+++ b/chrome/browser/extensions/app_host/app_host_main.cc
@@ -7,16 +7,20 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/process_util.h"
+#include "base/version.h"
huangs 2012/09/13 22:25:37 Oops, this snuck in. Deleting.
#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[] */) {
+ using namespace app_host;
+ using namespace chrome_launcher_support;
erikwright (departed) 2012/09/13 19:27:49 It seems these are no longer high-value as the two
huangs 2012/09/13 22:25:37 Done.
base::AtExitManager exit_manager;
// Initialize the commandline singleton from the environment.
CommandLine::Init(0, NULL);
- FilePath chrome_exe(chrome_launcher_support::GetAnyChromePath());
+ FilePath chrome_exe(GetAnyChromePath());
if (chrome_exe.empty()) {
LOG(INFO) << "No Chrome executable could be found. Let's install it.";
@@ -25,7 +29,7 @@ int main(int /* argc */, char* /* argv[] */) {
LOG(ERROR) << "Failed to install the Chrome Binaries. Error: " << hr;
return 1;
} else {
- chrome_exe = chrome_launcher_support::GetAnyChromePath();
+ chrome_exe = GetAnyChromePath();
if (chrome_exe.empty()) {
LOG(ERROR) << "Failed to find the Chrome Binaries despite a "
<< "'successful' installation.";
@@ -38,13 +42,16 @@ int main(int /* argc */, char* /* argv[] */) {
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);
grt (UTC plus 2) 2012/09/13 20:04:12 nit: move this to the previous line
huangs 2012/09/13 22:25:37 Done.
+ 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;
- }
+
+ EnsureAppHostUpToDate();
+
+ return !launch_result;
}
« no previous file with comments | « no previous file | chrome/browser/extensions/app_host/update.h » ('j') | chrome/browser/extensions/app_host/update.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698