Chromium Code Reviews| 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; |
| } |