From c1f87b2a4f2d08b92db6f0c7f4f6661d5166feb9 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Wed, 5 Oct 2011 21:59:33 +0000 Subject: Make an empty content browser test work. BUG=90448 Review URL: http://codereview.chromium.org/8137012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104181 0039d316-1c4b-4281-b951-d872f2087c98 --- content/shell/shell_main.cc | 58 +-------------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) (limited to 'content/shell/shell_main.cc') diff --git a/content/shell/shell_main.cc b/content/shell/shell_main.cc index c5a9227..d6b2dde 100644 --- a/content/shell/shell_main.cc +++ b/content/shell/shell_main.cc @@ -4,69 +4,13 @@ #include "content/app/content_main.h" -#include "base/command_line.h" -#include "base/memory/scoped_ptr.h" -#include "content/app/content_main_delegate.h" -#include "content/common/content_switches.h" -#include "content/shell/shell_content_browser_client.h" -#include "content/shell/shell_content_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 "content/shell/shell_main_delegate.h" #include "sandbox/src/sandbox_types.h" #if defined(OS_WIN) #include "content/app/startup_helper_win.h" #endif -namespace { - -class ShellMainDelegate : public content::ContentMainDelegate { - public: - virtual void PreSandboxStartup() OVERRIDE { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - std::string process_type = - command_line.GetSwitchValueASCII(switches::kProcessType); - - content::SetContentClient(&content_client_); - InitializeShellContentClient(process_type); - } - -#if defined(OS_POSIX) && !defined(OS_MACOSX) - virtual void ZygoteForked() OVERRIDE { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - std::string process_type = - command_line.GetSwitchValueASCII(switches::kProcessType); - InitializeShellContentClient(process_type); - } -#endif - - private: - void InitializeShellContentClient(const std::string& process_type) { - if (process_type.empty()) { - browser_client_.reset(new content::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()); - } - } - - scoped_ptr browser_client_; - scoped_ptr renderer_client_; - scoped_ptr plugin_client_; - scoped_ptr utility_client_; - content::ShellContentClient content_client_; -}; - -} // namespace - #if defined(OS_WIN) int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { -- cgit v1.1