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

Unified Diff: content/shell/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
« no previous file with comments | « content/shell/shell_main_delegate.h ('k') | content/test/content_test_suite.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
+}
« no previous file with comments | « content/shell/shell_main_delegate.h ('k') | content/test/content_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698