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

Unified Diff: ash/shell/content_client/shell_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: ash/shell/content_client/shell_main_delegate.cc
===================================================================
--- ash/shell/content_client/shell_main_delegate.cc (revision 140381)
+++ ash/shell/content_client/shell_main_delegate.cc (working copy)
@@ -9,9 +9,6 @@
#include "base/file_path.h"
#include "base/path_service.h"
#include "content/public/common/content_switches.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"
@@ -30,7 +27,6 @@
command_line.GetSwitchValueASCII(switches::kProcessType);
content::SetContentClient(&content_client_);
- InitializeShellContentClient(process_type);
return false;
}
@@ -39,33 +35,11 @@
InitializeResourceBundle();
}
-#if defined(OS_POSIX)
-
-void ShellMainDelegate::ZygoteForked() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- std::string process_type =
- command_line.GetSwitchValueASCII(switches::kProcessType);
- InitializeShellContentClient(process_type);
+content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
+ browser_client_.reset(new ShellContentBrowserClient);
+ return browser_client_.get();
}
-#endif
-void ShellMainDelegate::InitializeShellContentClient(
- const std::string& process_type) {
- if (process_type.empty()) {
- browser_client_.reset(new ShellContentBrowserClient);
- content::GetContentClient()->set_browser(browser_client_.get());
- } else if (process_type == switches::kRendererProcess) {
- 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() {
ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
}

Powered by Google App Engine
This is Rietveld 408576698