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

Unified Diff: content/shell/shell_main.cc

Issue 8137012: Make an empty content browser test work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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: content/shell/shell_main.cc
===================================================================
--- content/shell/shell_main.cc (revision 103728)
+++ content/shell/shell_main.cc (working copy)
@@ -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<content::ShellContentBrowserClient> browser_client_;
- scoped_ptr<content::ShellContentRendererClient> renderer_client_;
- scoped_ptr<content::ShellContentPluginClient> plugin_client_;
- scoped_ptr<content::ShellContentUtilityClient> utility_client_;
- content::ShellContentClient content_client_;
-};
-
-} // namespace
-
#if defined(OS_WIN)
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) {

Powered by Google App Engine
This is Rietveld 408576698