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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/shell/shell_main_delegate.h"
6
7 #include "base/command_line.h"
8 #include "content/common/content_switches.h"
9 #include "content/shell/shell_content_browser_client.h"
10 #include "content/shell/shell_content_plugin_client.h"
11 #include "content/shell/shell_content_renderer_client.h"
12 #include "content/shell/shell_content_utility_client.h"
13
14 ShellMainDelegate::ShellMainDelegate() {
15 }
16
17 ShellMainDelegate::~ShellMainDelegate() {
18 }
19
20 void ShellMainDelegate::PreSandboxStartup() {
21 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
22 std::string process_type =
23 command_line.GetSwitchValueASCII(switches::kProcessType);
24
25 content::SetContentClient(&content_client_);
26 InitializeShellContentClient(process_type);
27 }
28
29 #if defined(OS_POSIX) && !defined(OS_MACOSX)
30 void ShellMainDelegate::ZygoteForked() {
31 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
32 std::string process_type =
33 command_line.GetSwitchValueASCII(switches::kProcessType);
34 InitializeShellContentClient(process_type);
35 }
36 #endif
37
38 void ShellMainDelegate::InitializeShellContentClient(
39 const std::string& process_type) {
40 if (process_type.empty()) {
41 browser_client_.reset(new content::ShellContentBrowserClient);
42 content::GetContentClient()->set_browser(browser_client_.get());
43 } else if (process_type == switches::kRendererProcess) {
44 renderer_client_.reset(new content::ShellContentRendererClient);
45 content::GetContentClient()->set_renderer(renderer_client_.get());
46 } else if (process_type == switches::kPluginProcess) {
47 plugin_client_.reset(new content::ShellContentPluginClient);
48 content::GetContentClient()->set_plugin(plugin_client_.get());
49 } else if (process_type == switches::kUtilityProcess) {
50 utility_client_.reset(new content::ShellContentUtilityClient);
51 content::GetContentClient()->set_utility(utility_client_.get());
52 }
53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698