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

Side by Side Diff: content/shell/shell_main_delegate.cc

Issue 10115048: Fix single process mode in content_shell. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « content/browser/browser_main_runner.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/shell_main_delegate.h" 5 #include "content/shell/shell_main_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 command_line.GetSwitchValueASCII(switches::kProcessType); 90 command_line.GetSwitchValueASCII(switches::kProcessType);
91 InitializeShellContentClient(process_type); 91 InitializeShellContentClient(process_type);
92 } 92 }
93 #endif // OS_MACOSX 93 #endif // OS_MACOSX
94 94
95 void ShellMainDelegate::InitializeShellContentClient( 95 void ShellMainDelegate::InitializeShellContentClient(
96 const std::string& process_type) { 96 const std::string& process_type) {
97 if (process_type.empty()) { 97 if (process_type.empty()) {
98 browser_client_.reset(new content::ShellContentBrowserClient); 98 browser_client_.reset(new content::ShellContentBrowserClient);
99 content::GetContentClient()->set_browser(browser_client_.get()); 99 content::GetContentClient()->set_browser(browser_client_.get());
100 } else if (process_type == switches::kRendererProcess) { 100 }
101
102 if (process_type == switches::kRendererProcess ||
103 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) {
101 renderer_client_.reset(new content::ShellContentRendererClient); 104 renderer_client_.reset(new content::ShellContentRendererClient);
102 content::GetContentClient()->set_renderer(renderer_client_.get()); 105 content::GetContentClient()->set_renderer(renderer_client_.get());
103 } else if (process_type == switches::kPluginProcess) { 106 } else if (process_type == switches::kPluginProcess) {
104 plugin_client_.reset(new content::ShellContentPluginClient); 107 plugin_client_.reset(new content::ShellContentPluginClient);
105 content::GetContentClient()->set_plugin(plugin_client_.get()); 108 content::GetContentClient()->set_plugin(plugin_client_.get());
106 } else if (process_type == switches::kUtilityProcess) { 109 } else if (process_type == switches::kUtilityProcess) {
107 utility_client_.reset(new content::ShellContentUtilityClient); 110 utility_client_.reset(new content::ShellContentUtilityClient);
108 content::GetContentClient()->set_utility(utility_client_.get()); 111 content::GetContentClient()->set_utility(utility_client_.get());
109 } 112 }
110 } 113 }
111 114
112 void ShellMainDelegate::InitializeResourceBundle() { 115 void ShellMainDelegate::InitializeResourceBundle() {
113 FilePath pak_file; 116 FilePath pak_file;
114 #if defined(OS_MACOSX) 117 #if defined(OS_MACOSX)
115 pak_file = GetResourcesPakFilePath(); 118 pak_file = GetResourcesPakFilePath();
116 #else 119 #else
117 FilePath pak_dir; 120 FilePath pak_dir;
118 PathService::Get(base::DIR_MODULE, &pak_dir); 121 PathService::Get(base::DIR_MODULE, &pak_dir);
119 pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak")); 122 pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak"));
120 #endif 123 #endif
121 ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_file); 124 ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_file);
122 } 125 }
OLDNEW
« no previous file with comments | « content/browser/browser_main_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698