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

Unified Diff: chrome/app/chrome_main_delegate.cc

Issue 10479023: Simplify how Content*Client interfaces are created. Instead of depending on the embedder to know wh… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove unused function declaration 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
Index: chrome/app/chrome_main_delegate.cc
===================================================================
--- chrome/app/chrome_main_delegate.cc (revision 140381)
+++ chrome/app/chrome_main_delegate.cc (working copy)
@@ -255,26 +255,6 @@
#endif
}
-void InitializeChromeContentRendererClient() {
- content::GetContentClient()->set_renderer(
- &g_chrome_content_renderer_client.Get());
-}
-
-void InitializeChromeContentClient(const std::string& process_type) {
- if (process_type.empty()) {
- content::GetContentClient()->set_browser(
- &g_chrome_content_browser_client.Get());
- } else if (process_type == switches::kPluginProcess) {
- content::GetContentClient()->set_plugin(
- &g_chrome_content_plugin_client.Get());
- } else if (process_type == switches::kRendererProcess) {
- InitializeChromeContentRendererClient();
- } else if (process_type == switches::kUtilityProcess) {
- content::GetContentClient()->set_utility(
- &g_chrome_content_utility_client.Get());
- }
-}
-
// Returns true if this subprocess type needs the ResourceBundle initialized
// and resources loaded.
bool SubprocessNeedsResourceBundle(const std::string& process_type) {
@@ -447,10 +427,7 @@
base::FieldTrial::EnableBenchmarking();
}
- std::string process_type = command_line.GetSwitchValueASCII(
- switches::kProcessType);
content::SetContentClient(&chrome_content_client_);
- InitializeChromeContentClient(process_type);
return false;
}
@@ -584,9 +561,6 @@
if (command_line.HasSwitch(switches::kMessageLoopHistogrammer))
MessageLoop::EnableHistogrammer(true);
- if (command_line.HasSwitch(switches::kSingleProcess))
- InitializeChromeContentRendererClient();
-
logging::OldFileDeletionState file_state =
logging::APPEND_TO_OLD_LOG_FILE;
if (process_type.empty()) {
@@ -716,10 +690,6 @@
}
void ChromeMainDelegate::ZygoteForked() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- std::string process_type =
- command_line.GetSwitchValueASCII(switches::kProcessType);
-
Profiling::ProcessStarted();
if (Profiling::BeingProfiled()) {
base::debug::RestartProfilingAfterFork();
@@ -731,7 +701,25 @@
// this up for the browser process in a different manner.
InitCrashReporter();
#endif
-
- InitializeChromeContentClient(process_type);
}
+
#endif // OS_MACOSX
+
+content::ContentBrowserClient*
+ ChromeMainDelegate::CreateContentBrowserClient() {
+ return &g_chrome_content_browser_client.Get();
+}
+
+content::ContentPluginClient* ChromeMainDelegate::CreateContentPluginClient() {
+ return &g_chrome_content_plugin_client.Get();
+}
+
+content::ContentRendererClient*
+ ChromeMainDelegate::CreateContentRendererClient() {
+ return &g_chrome_content_renderer_client.Get();
+}
+
+content::ContentUtilityClient*
+ ChromeMainDelegate::CreateContentUtilityClient() {
+ return &g_chrome_content_utility_client.Get();
+}

Powered by Google App Engine
This is Rietveld 408576698