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

Unified Diff: chrome/browser/extensions/app_host_stub_main.cc

Issue 10559090: Initial commit of the App Host stub. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/app_host_stub_main.cc
diff --git a/chrome/browser/extensions/app_host_stub_main.cc b/chrome/browser/extensions/app_host_stub_main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c2d5e0b912bc230635359159f61eab05da520a17
--- /dev/null
+++ b/chrome/browser/extensions/app_host_stub_main.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/at_exit.h"
+#include "base/command_line.h"
+#include "base/file_path.h"
+#include "base/logging.h"
+#include "base/process_util.h"
+#include "chrome/installer/launcher_support/chrome_launcher_support.h"
+
+namespace {
+
+const wchar_t kChromeExe[] = L"chrome.exe";
miket_OOO 2012/07/19 18:01:02 I'm looking for confirmation that the wchar_t type
+
+} // namespace
+
+int main(int /* argc */, char* /* argv[] */) {
+ base::AtExitManager exit_manager;
+
+ // Initialize the commandline singleton from the environment.
+ CommandLine::Init(0, NULL);
+
+ 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;
+ }
+
+ 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)) {
+ LOG(INFO) << "Delegated to Chrome executable at " << chrome_exe.value();
+ return 0;
+ } else {
+ LOG(INFO) << "Failed to launch Chrome executable at " << chrome_exe.value();
+ return 1;
+ }
+}
« no previous file with comments | « no previous file | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698