| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/shell_main_delegate.h" | 5 #include "content/shell/shell_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
| 9 #include "content/shell/shell_content_browser_client.h" | 9 #include "content/shell/shell_content_browser_client.h" |
| 10 #include "content/shell/shell_content_plugin_client.h" | 10 #include "content/shell/shell_content_plugin_client.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 bool ShellMainDelegate::ShouldSendMachPort(const std::string& process_type) { | 52 bool ShellMainDelegate::ShouldSendMachPort(const std::string& process_type) { |
| 53 return false; | 53 return false; |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool ShellMainDelegate::DelaySandboxInitialization( | 56 bool ShellMainDelegate::DelaySandboxInitialization( |
| 57 const std::string& process_type) { | 57 const std::string& process_type) { |
| 58 return false; | 58 return false; |
| 59 } | 59 } |
| 60 | 60 |
| 61 #elif defined(OS_POSIX) | 61 #elif defined(OS_POSIX) |
| 62 ZygoteForkDelegate* ShellMainDelegate::ZygoteStarting() { | 62 content::ZygoteForkDelegate* ShellMainDelegate::ZygoteStarting() { |
| 63 return NULL; | 63 return NULL; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ShellMainDelegate::ZygoteForked() { | 66 void ShellMainDelegate::ZygoteForked() { |
| 67 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 67 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 68 std::string process_type = | 68 std::string process_type = |
| 69 command_line.GetSwitchValueASCII(switches::kProcessType); | 69 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 70 InitializeShellContentClient(process_type); | 70 InitializeShellContentClient(process_type); |
| 71 } | 71 } |
| 72 #endif // OS_MACOSX | 72 #endif // OS_MACOSX |
| 73 | 73 |
| 74 void ShellMainDelegate::InitializeShellContentClient( | 74 void ShellMainDelegate::InitializeShellContentClient( |
| 75 const std::string& process_type) { | 75 const std::string& process_type) { |
| 76 if (process_type.empty()) { | 76 if (process_type.empty()) { |
| 77 browser_client_.reset(new content::ShellContentBrowserClient); | 77 browser_client_.reset(new content::ShellContentBrowserClient); |
| 78 content::GetContentClient()->set_browser(browser_client_.get()); | 78 content::GetContentClient()->set_browser(browser_client_.get()); |
| 79 } else if (process_type == switches::kRendererProcess) { | 79 } else if (process_type == switches::kRendererProcess) { |
| 80 renderer_client_.reset(new content::ShellContentRendererClient); | 80 renderer_client_.reset(new content::ShellContentRendererClient); |
| 81 content::GetContentClient()->set_renderer(renderer_client_.get()); | 81 content::GetContentClient()->set_renderer(renderer_client_.get()); |
| 82 } else if (process_type == switches::kPluginProcess) { | 82 } else if (process_type == switches::kPluginProcess) { |
| 83 plugin_client_.reset(new content::ShellContentPluginClient); | 83 plugin_client_.reset(new content::ShellContentPluginClient); |
| 84 content::GetContentClient()->set_plugin(plugin_client_.get()); | 84 content::GetContentClient()->set_plugin(plugin_client_.get()); |
| 85 } else if (process_type == switches::kUtilityProcess) { | 85 } else if (process_type == switches::kUtilityProcess) { |
| 86 utility_client_.reset(new content::ShellContentUtilityClient); | 86 utility_client_.reset(new content::ShellContentUtilityClient); |
| 87 content::GetContentClient()->set_utility(utility_client_.get()); | 87 content::GetContentClient()->set_utility(utility_client_.get()); |
| 88 } | 88 } |
| 89 } | 89 } |
| OLD | NEW |