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

Unified Diff: content/shell/shell_main_delegate.cc

Issue 9617032: Fix tweak_info_plist.py to be explicit about arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: first upload Created 8 years, 9 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 | « content/shell/shell_browser_main_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_main_delegate.cc
diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc
index 0a3977b1f641dba7740aca5a95cc40b236e0487d..90e2b9756905097f0ea750d97afb6669ab974499 100644
--- a/content/shell/shell_main_delegate.cc
+++ b/content/shell/shell_main_delegate.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/file_path.h"
#include "base/path_service.h"
+#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/shell/shell_content_browser_client.h"
#include "content/shell/shell_content_plugin_client.h"
@@ -16,6 +17,42 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#if defined(OS_MACOSX)
+#include "base/mac/foundation_util.h"
+#endif
+
+#if defined(OS_MACOSX)
+namespace {
+
+void OverrideChildProcessPath() {
+ if (base::mac::IsBackgroundOnlyProcess()) {
+ // The background-only process is the helper; no overriding needed.
+ return;
+ }
+
+ // Start out with the path to the running executable.
+ FilePath helper_path;
+ PathService::Get(base::FILE_EXE, &helper_path);
+
+ // One step up to MacOS, another to Contents.
+ helper_path = helper_path.DirName().DirName();
+ DCHECK_EQ(helper_path.BaseName().value(), "Contents");
+
+ // Go into the frameworks directory.
+ helper_path = helper_path.Append("Frameworks");
+
+ // And the app path.
+ helper_path = helper_path.Append("Content Shell Helper.app")
+ .Append("Contents")
+ .Append("MacOS")
+ .Append("Content Shell Helper");
+
+ PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
+}
+
+}
+#endif // OS_MACOSX
+
ShellMainDelegate::ShellMainDelegate() {
}
@@ -27,6 +64,10 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
}
void ShellMainDelegate::PreSandboxStartup() {
+#if defined(OS_MACOSX)
+ OverrideChildProcessPath();
+#endif // OS_MACOSX
+
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
« no previous file with comments | « content/shell/shell_browser_main_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698