Index: content/shell/shell_main_delegate.cc |
=================================================================== |
--- content/shell/shell_main_delegate.cc (revision 140381) |
+++ content/shell/shell_main_delegate.cc (working copy) |
@@ -11,9 +11,7 @@ |
#include "content/public/common/url_constants.h" |
#include "content/shell/shell_browser_main.h" |
#include "content/shell/shell_content_browser_client.h" |
-#include "content/shell/shell_content_plugin_client.h" |
#include "content/shell/shell_content_renderer_client.h" |
-#include "content/shell/shell_content_utility_client.h" |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/base/ui_base_paths.h" |
@@ -34,12 +32,7 @@ |
#if defined(OS_MACOSX) |
OverrideFrameworkBundlePath(); |
#endif |
- const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
- std::string process_type = |
- command_line.GetSwitchValueASCII(switches::kProcessType); |
content::SetContentClient(&content_client_); |
- InitializeShellContentClient(process_type); |
- |
return false; |
} |
@@ -59,35 +52,6 @@ |
return ShellBrowserMain(main_function_params); |
} |
-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
-void ShellMainDelegate::ZygoteForked() { |
- const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
- std::string process_type = |
- command_line.GetSwitchValueASCII(switches::kProcessType); |
- InitializeShellContentClient(process_type); |
-} |
-#endif |
- |
-void ShellMainDelegate::InitializeShellContentClient( |
- const std::string& process_type) { |
- if (process_type.empty()) { |
- browser_client_.reset(new content::ShellContentBrowserClient); |
- content::GetContentClient()->set_browser(browser_client_.get()); |
- } |
- |
- if (process_type == switches::kRendererProcess || |
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) { |
- renderer_client_.reset(new content::ShellContentRendererClient); |
- content::GetContentClient()->set_renderer(renderer_client_.get()); |
- } else if (process_type == switches::kPluginProcess) { |
- plugin_client_.reset(new content::ShellContentPluginClient); |
- content::GetContentClient()->set_plugin(plugin_client_.get()); |
- } else if (process_type == switches::kUtilityProcess) { |
- utility_client_.reset(new content::ShellContentUtilityClient); |
- content::GetContentClient()->set_utility(utility_client_.get()); |
- } |
-} |
- |
void ShellMainDelegate::InitializeResourceBundle() { |
FilePath pak_file; |
#if defined(OS_MACOSX) |
@@ -106,3 +70,15 @@ |
#endif |
ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_file); |
} |
+ |
+content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { |
+ browser_client_.reset(new content::ShellContentBrowserClient); |
+ return browser_client_.get(); |
+} |
+ |
+content::ContentRendererClient* |
+ ShellMainDelegate::CreateContentRendererClient() { |
+ renderer_client_.reset(new content::ShellContentRendererClient); |
+ return renderer_client_.get(); |
+ |
Jói
2012/06/05 11:26:54
nit: weird blank line
|
+} |