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

Unified Diff: content/shell/shell_main_delegate.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_delegate.cc
===================================================================
--- content/shell/shell_main_delegate.cc (revision 0)
+++ content/shell/shell_main_delegate.cc (revision 0)
@@ -0,0 +1,52 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/shell/shell_main_delegate.h"
+
+#include "base/command_line.h"
+#include "content/common/content_switches.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"
+
+ShellMainDelegate::ShellMainDelegate() {
+}
+
+ShellMainDelegate::~ShellMainDelegate() {
+}
+
+void ShellMainDelegate::PreSandboxStartup() {
+ 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)
+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) {
jam 2011/10/04 22:21:13 nit: 80 chars
Paweł Hajdan Jr. 2011/10/04 23:19:48 Done.
+ 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());
+ }
+}
Property changes on: content\shell\shell_main_delegate.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698