OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 command_line.GetSwitchValueASCII(switches::kProcessType); | 90 command_line.GetSwitchValueASCII(switches::kProcessType); |
91 InitializeShellContentClient(process_type); | 91 InitializeShellContentClient(process_type); |
92 } | 92 } |
93 #endif // OS_MACOSX | 93 #endif // OS_MACOSX |
94 | 94 |
95 void ShellMainDelegate::InitializeShellContentClient( | 95 void ShellMainDelegate::InitializeShellContentClient( |
96 const std::string& process_type) { | 96 const std::string& process_type) { |
97 if (process_type.empty()) { | 97 if (process_type.empty()) { |
98 browser_client_.reset(new content::ShellContentBrowserClient); | 98 browser_client_.reset(new content::ShellContentBrowserClient); |
99 content::GetContentClient()->set_browser(browser_client_.get()); | 99 content::GetContentClient()->set_browser(browser_client_.get()); |
100 } else if (process_type == switches::kRendererProcess) { | 100 } |
| 101 |
| 102 if (process_type == switches::kRendererProcess || |
| 103 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) { |
101 renderer_client_.reset(new content::ShellContentRendererClient); | 104 renderer_client_.reset(new content::ShellContentRendererClient); |
102 content::GetContentClient()->set_renderer(renderer_client_.get()); | 105 content::GetContentClient()->set_renderer(renderer_client_.get()); |
103 } else if (process_type == switches::kPluginProcess) { | 106 } else if (process_type == switches::kPluginProcess) { |
104 plugin_client_.reset(new content::ShellContentPluginClient); | 107 plugin_client_.reset(new content::ShellContentPluginClient); |
105 content::GetContentClient()->set_plugin(plugin_client_.get()); | 108 content::GetContentClient()->set_plugin(plugin_client_.get()); |
106 } else if (process_type == switches::kUtilityProcess) { | 109 } else if (process_type == switches::kUtilityProcess) { |
107 utility_client_.reset(new content::ShellContentUtilityClient); | 110 utility_client_.reset(new content::ShellContentUtilityClient); |
108 content::GetContentClient()->set_utility(utility_client_.get()); | 111 content::GetContentClient()->set_utility(utility_client_.get()); |
109 } | 112 } |
110 } | 113 } |
111 | 114 |
112 void ShellMainDelegate::InitializeResourceBundle() { | 115 void ShellMainDelegate::InitializeResourceBundle() { |
113 FilePath pak_file; | 116 FilePath pak_file; |
114 #if defined(OS_MACOSX) | 117 #if defined(OS_MACOSX) |
115 pak_file = GetResourcesPakFilePath(); | 118 pak_file = GetResourcesPakFilePath(); |
116 #else | 119 #else |
117 FilePath pak_dir; | 120 FilePath pak_dir; |
118 PathService::Get(base::DIR_MODULE, &pak_dir); | 121 PathService::Get(base::DIR_MODULE, &pak_dir); |
119 pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak")); | 122 pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak")); |
120 #endif | 123 #endif |
121 ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_file); | 124 ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_file); |
122 } | 125 } |
OLD | NEW |