OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/shell_content_browser_client.h" | 5 #include "content/shell/browser/shell_content_browser_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 std::string process_type = | 93 std::string process_type = |
94 command_line.GetSwitchValueASCII(switches::kProcessType); | 94 command_line.GetSwitchValueASCII(switches::kProcessType); |
95 | 95 |
96 if (process_type == switches::kRendererProcess) { | 96 if (process_type == switches::kRendererProcess) { |
97 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; | 97 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; |
98 if (!crash_handler) | 98 if (!crash_handler) |
99 crash_handler = CreateCrashHandlerHost(process_type); | 99 crash_handler = CreateCrashHandlerHost(process_type); |
100 return crash_handler->GetDeathSignalSocket(); | 100 return crash_handler->GetDeathSignalSocket(); |
101 } | 101 } |
102 | 102 |
103 if (process_type == switches::kPluginProcess) { | |
104 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; | |
105 if (!crash_handler) | |
106 crash_handler = CreateCrashHandlerHost(process_type); | |
107 return crash_handler->GetDeathSignalSocket(); | |
108 } | |
109 | |
110 if (process_type == switches::kPpapiPluginProcess) { | 103 if (process_type == switches::kPpapiPluginProcess) { |
111 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; | 104 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; |
112 if (!crash_handler) | 105 if (!crash_handler) |
113 crash_handler = CreateCrashHandlerHost(process_type); | 106 crash_handler = CreateCrashHandlerHost(process_type); |
114 return crash_handler->GetDeathSignalSocket(); | 107 return crash_handler->GetDeathSignalSocket(); |
115 } | 108 } |
116 | 109 |
117 if (process_type == switches::kGpuProcess) { | 110 if (process_type == switches::kGpuProcess) { |
118 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; | 111 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; |
119 if (!crash_handler) | 112 if (!crash_handler) |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 url::kDataScheme, | 194 url::kDataScheme, |
202 url::kFileScheme, | 195 url::kFileScheme, |
203 }; | 196 }; |
204 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 197 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
205 if (url.scheme() == kProtocolList[i]) | 198 if (url.scheme() == kProtocolList[i]) |
206 return true; | 199 return true; |
207 } | 200 } |
208 return false; | 201 return false; |
209 } | 202 } |
210 | 203 |
211 bool ShellContentBrowserClient::IsNPAPIEnabled() { | |
212 #if defined(OS_WIN) || defined(OS_MACOSX) | |
213 return true; | |
214 #else | |
215 return false; | |
216 #endif | |
217 } | |
218 | |
219 void ShellContentBrowserClient::RegisterInProcessMojoApplications( | 204 void ShellContentBrowserClient::RegisterInProcessMojoApplications( |
220 StaticMojoApplicationMap* apps) { | 205 StaticMojoApplicationMap* apps) { |
221 #if (ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) | 206 #if (ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) |
222 apps->insert(std::make_pair("mojo:media", | 207 apps->insert(std::make_pair("mojo:media", |
223 base::Bind(&media::CreateMojoMediaApplication))); | 208 base::Bind(&media::CreateMojoMediaApplication))); |
224 #endif | 209 #endif |
225 } | 210 } |
226 | 211 |
227 void ShellContentBrowserClient::RegisterOutOfProcessMojoApplications( | 212 void ShellContentBrowserClient::RegisterOutOfProcessMojoApplications( |
228 OutOfProcessMojoApplicationMap* apps) { | 213 OutOfProcessMojoApplicationMap* apps) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 ShellBrowserContext* | 383 ShellBrowserContext* |
399 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 384 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
400 BrowserContext* content_browser_context) { | 385 BrowserContext* content_browser_context) { |
401 if (content_browser_context == browser_context()) | 386 if (content_browser_context == browser_context()) |
402 return browser_context(); | 387 return browser_context(); |
403 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 388 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
404 return off_the_record_browser_context(); | 389 return off_the_record_browser_context(); |
405 } | 390 } |
406 | 391 |
407 } // namespace content | 392 } // namespace content |
OLD | NEW |