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

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

Issue 10825364: Upon execution of the App Host, ask Omaha to install the Chrome Binaries if they are not present on… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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_stub_main.cc b/chrome/browser/extensions/app_host/app_host_main.cc
similarity index 66%
rename from chrome/browser/extensions/app_host_stub_main.cc
rename to chrome/browser/extensions/app_host/app_host_main.cc
index 291b1cedb8a5607849da976d80aec2d4733b4428..10d044a57cbf93c2e524ceead7b669a8763e726d 100644
--- a/chrome/browser/extensions/app_host_stub_main.cc
+++ b/chrome/browser/extensions/app_host/app_host_main.cc
@@ -7,14 +7,9 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/process_util.h"
+#include "chrome/browser/extensions/app_host/binaries_installer.h"
#include "chrome/installer/launcher_support/chrome_launcher_support.h"
-namespace {
-
-const wchar_t kChromeExe[] = L"chrome.exe";
-
-} // namespace
-
int main(int /* argc */, char* /* argv[] */) {
base::AtExitManager exit_manager;
@@ -24,9 +19,19 @@ int main(int /* argc */, char* /* argv[] */) {
FilePath chrome_exe(chrome_launcher_support::GetAnyChromePath());
if (chrome_exe.empty()) {
- LOG(ERROR) << "No Chrome executable could be found.";
- // TODO(erikwright): install Chrome.
- return 1;
+ LOG(INFO) << "No Chrome executable could be found. Let's install it.";
robertshield 2012/08/16 13:08:16 Does the app host / Omaha show any kind of UI whil
erikwright (departed) 2012/08/16 21:05:15 Not at the moment. App Host probably should before
+ HRESULT hr = app_host::InstallBinaries();
+ if (FAILED(hr)) {
+ LOG(ERROR) << "Failed to install the Chrome Binaries. Error: " << hr;
+ return 1;
+ } else {
+ chrome_exe = chrome_launcher_support::GetAnyChromePath();
+ if (chrome_exe.empty()) {
+ LOG(ERROR) << "Failed to find the Chrome Binaries despite a "
+ << "'successful' installation.";
+ return 1;
+ }
+ }
}
CommandLine chrome_exe_command_line(chrome_exe);

Powered by Google App Engine
This is Rietveld 408576698