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

Unified Diff: ui/views/examples/content_client/examples_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: ui/views/examples/content_client/examples_main_delegate.cc
===================================================================
--- ui/views/examples/content_client/examples_main_delegate.cc (revision 140381)
+++ ui/views/examples/content_client/examples_main_delegate.cc (working copy)
@@ -11,9 +11,6 @@
#include "base/logging.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"
#include "ui/views/examples/content_client/examples_content_browser_client.h"
@@ -47,7 +44,6 @@
command_line.GetSwitchValueASCII(switches::kProcessType);
content::SetContentClient(&content_client_);
- InitializeShellContentClient(process_type);
bool success = logging::InitLogging(NULL,
logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
@@ -66,32 +62,12 @@
InitializeResourceBundle();
}
-#if defined(OS_POSIX)
-void ExamplesMainDelegate::ZygoteForked() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- std::string process_type =
- command_line.GetSwitchValueASCII(switches::kProcessType);
- InitializeShellContentClient(process_type);
+content::ContentBrowserClient*
+ ExamplesMainDelegate::CreateContentBrowserClient() {
+ browser_client_.reset(new ExamplesContentBrowserClient);
+ return browser_client_.get();
}
-#endif
-void ExamplesMainDelegate::InitializeShellContentClient(
- const std::string& process_type) {
- if (process_type.empty()) {
- browser_client_.reset(new ExamplesContentBrowserClient);
- 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 ExamplesMainDelegate::InitializeResourceBundle() {
ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
}

Powered by Google App Engine
This is Rietveld 408576698