Build net_unittests in Mac GN.
[chromium-blink-merge.git] / chrome / common / chrome_content_client.cc
blob57a0b4fb552457cea54628742084625a63c94616
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
3 // found in the LICENSE file.
5 #include "chrome/common/chrome_content_client.h"
7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h"
9 #include "base/files/file_util.h"
10 #include "base/json/json_reader.h"
11 #include "base/path_service.h"
12 #include "base/strings/string16.h"
13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/string_split.h"
15 #include "base/strings/string_util.h"
16 #include "base/strings/stringprintf.h"
17 #include "base/strings/utf_string_conversions.h"
18 #include "build/build_config.h"
19 #include "chrome/common/child_process_logging.h"
20 #include "chrome/common/chrome_constants.h"
21 #include "chrome/common/chrome_paths.h"
22 #include "chrome/common/chrome_switches.h"
23 #include "chrome/common/chrome_version_info.h"
24 #include "chrome/common/crash_keys.h"
25 #include "chrome/common/pepper_flash.h"
26 #include "chrome/common/secure_origin_whitelist.h"
27 #include "chrome/common/url_constants.h"
28 #include "chrome/grit/common_resources.h"
29 #include "components/dom_distiller/core/url_constants.h"
30 #include "content/public/common/content_constants.h"
31 #include "content/public/common/content_switches.h"
32 #include "content/public/common/url_constants.h"
33 #include "content/public/common/user_agent.h"
34 #include "extensions/common/constants.h"
35 #include "gpu/config/gpu_info.h"
36 #include "net/http/http_util.h"
37 #include "ui/base/l10n/l10n_util.h"
38 #include "ui/base/layout.h"
39 #include "ui/base/resource/resource_bundle.h"
41 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
43 #if defined(OS_WIN)
44 #include "base/win/registry.h"
45 #include "base/win/windows_version.h"
46 #endif
48 #if !defined(DISABLE_NACL)
49 #include "components/nacl/common/nacl_constants.h"
50 #include "components/nacl/common/nacl_process_type.h"
51 #include "components/nacl/common/nacl_sandbox_type.h"
52 #endif
54 #if defined(ENABLE_PLUGINS)
55 #include "content/public/common/pepper_plugin_info.h"
56 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR.
57 #include "ppapi/shared_impl/ppapi_permissions.h"
58 #endif
60 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
61 !defined(WIDEVINE_CDM_IS_COMPONENT)
62 #include "chrome/common/widevine_cdm_constants.h"
63 #endif
65 namespace {
67 #if defined(ENABLE_PLUGINS)
68 const char kPDFPluginExtension[] = "pdf";
69 const char kPDFPluginDescription[] = "Portable Document Format";
70 const char kPDFPluginOutOfProcessMimeType[] =
71 "application/x-google-chrome-pdf";
72 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE |
73 ppapi::PERMISSION_DEV;
75 content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface;
76 content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module;
77 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module;
79 #if defined(ENABLE_REMOTING)
81 content::PepperPluginInfo::GetInterfaceFunc g_remoting_get_interface;
82 content::PepperPluginInfo::PPP_InitializeModuleFunc
83 g_remoting_initialize_module;
84 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_remoting_shutdown_module;
86 #if defined(GOOGLE_CHROME_BUILD)
87 const char kRemotingViewerPluginName[] = "Chrome Remote Desktop Viewer";
88 #else
89 const char kRemotingViewerPluginName[] = "Chromoting Viewer";
90 #endif // defined(GOOGLE_CHROME_BUILD)
91 const char kRemotingViewerPluginDescription[] =
92 "This plugin allows you to securely access other computers that have been "
93 "shared with you. To use this plugin you must first install the "
94 "<a href=\"https://chrome.google.com/remotedesktop\">"
95 "Chrome Remote Desktop</a> webapp.";
96 // Use a consistent MIME-type regardless of branding.
97 const char kRemotingViewerPluginMimeType[] =
98 "application/vnd.chromium.remoting-viewer";
99 const char kRemotingViewerPluginMimeExtension[] = "";
100 const char kRemotingViewerPluginMimeDescription[] = "";
101 const uint32 kRemotingViewerPluginPermissions = ppapi::PERMISSION_PRIVATE |
102 ppapi::PERMISSION_DEV;
103 #endif // defined(ENABLE_REMOTING)
105 #if !defined(DISABLE_NACL)
106 content::PepperPluginInfo::GetInterfaceFunc g_nacl_get_interface;
107 content::PepperPluginInfo::PPP_InitializeModuleFunc g_nacl_initialize_module;
108 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module;
109 #endif
111 // Appends the known built-in plugins to the given vector. Some built-in
112 // plugins are "internal" which means they are compiled into the Chrome binary,
113 // and some are extra shared libraries distributed with the browser (these are
114 // not marked internal, aside from being automatically registered, they're just
115 // regular plugins).
116 void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
117 content::PepperPluginInfo pdf_info;
118 pdf_info.is_internal = true;
119 pdf_info.is_out_of_process = true;
120 pdf_info.name = ChromeContentClient::kPDFPluginName;
121 pdf_info.description = kPDFPluginDescription;
122 pdf_info.path = base::FilePath::FromUTF8Unsafe(
123 ChromeContentClient::kPDFPluginPath);
124 content::WebPluginMimeType pdf_mime_type(
125 kPDFPluginOutOfProcessMimeType,
126 kPDFPluginExtension,
127 kPDFPluginDescription);
128 pdf_info.mime_types.push_back(pdf_mime_type);
129 pdf_info.internal_entry_points.get_interface = g_pdf_get_interface;
130 pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module;
131 pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module;
132 pdf_info.permissions = kPDFPluginPermissions;
133 plugins->push_back(pdf_info);
135 base::FilePath path;
137 #if !defined(DISABLE_NACL)
138 // Handle Native Client just like the PDF plugin. This means that it is
139 // enabled by default for the non-portable case. This allows apps installed
140 // from the Chrome Web Store to use NaCl even if the command line switch
141 // isn't set. For other uses of NaCl we check for the command line switch.
142 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) {
143 content::PepperPluginInfo nacl;
144 // The nacl plugin is now built into the Chromium binary.
145 nacl.is_internal = true;
146 nacl.path = path;
147 nacl.name = nacl::kNaClPluginName;
148 content::WebPluginMimeType nacl_mime_type(nacl::kNaClPluginMimeType,
149 nacl::kNaClPluginExtension,
150 nacl::kNaClPluginDescription);
151 nacl.mime_types.push_back(nacl_mime_type);
152 content::WebPluginMimeType pnacl_mime_type(nacl::kPnaclPluginMimeType,
153 nacl::kPnaclPluginExtension,
154 nacl::kPnaclPluginDescription);
155 nacl.mime_types.push_back(pnacl_mime_type);
156 nacl.internal_entry_points.get_interface = g_nacl_get_interface;
157 nacl.internal_entry_points.initialize_module = g_nacl_initialize_module;
158 nacl.internal_entry_points.shutdown_module = g_nacl_shutdown_module;
159 nacl.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV;
160 plugins->push_back(nacl);
162 #endif // !defined(DISABLE_NACL)
164 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
165 !defined(WIDEVINE_CDM_IS_COMPONENT)
166 static bool skip_widevine_cdm_file_check = false;
167 if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &path)) {
168 if (skip_widevine_cdm_file_check || base::PathExists(path)) {
169 content::PepperPluginInfo widevine_cdm;
170 widevine_cdm.is_out_of_process = true;
171 widevine_cdm.path = path;
172 widevine_cdm.name = kWidevineCdmDisplayName;
173 widevine_cdm.description = kWidevineCdmDescription +
174 std::string(" (version: ") +
175 WIDEVINE_CDM_VERSION_STRING + ")";
176 widevine_cdm.version = WIDEVINE_CDM_VERSION_STRING;
177 content::WebPluginMimeType widevine_cdm_mime_type(
178 kWidevineCdmPluginMimeType,
179 kWidevineCdmPluginExtension,
180 kWidevineCdmPluginMimeTypeDescription);
182 // Add the supported codecs as if they came from the component manifest.
183 std::vector<std::string> codecs;
184 codecs.push_back(kCdmSupportedCodecVorbis);
185 codecs.push_back(kCdmSupportedCodecVp8);
186 codecs.push_back(kCdmSupportedCodecVp9);
187 #if defined(USE_PROPRIETARY_CODECS)
188 codecs.push_back(kCdmSupportedCodecAac);
189 codecs.push_back(kCdmSupportedCodecAvc1);
190 #endif // defined(USE_PROPRIETARY_CODECS)
191 std::string codec_string = base::JoinString(
192 codecs, std::string(1, kCdmSupportedCodecsValueDelimiter));
193 widevine_cdm_mime_type.additional_param_names.push_back(
194 base::ASCIIToUTF16(kCdmSupportedCodecsParamName));
195 widevine_cdm_mime_type.additional_param_values.push_back(
196 base::ASCIIToUTF16(codec_string));
198 widevine_cdm.mime_types.push_back(widevine_cdm_mime_type);
199 widevine_cdm.permissions = kWidevineCdmPluginPermissions;
200 plugins->push_back(widevine_cdm);
202 skip_widevine_cdm_file_check = true;
205 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
206 // !defined(WIDEVINE_CDM_IS_COMPONENT)
208 // The Remoting Viewer plugin is built-in.
209 #if defined(ENABLE_REMOTING)
210 content::PepperPluginInfo info;
211 info.is_internal = true;
212 info.is_out_of_process = true;
213 info.name = kRemotingViewerPluginName;
214 info.description = kRemotingViewerPluginDescription;
215 info.path = base::FilePath::FromUTF8Unsafe(
216 ChromeContentClient::kRemotingViewerPluginPath);
217 content::WebPluginMimeType remoting_mime_type(
218 kRemotingViewerPluginMimeType,
219 kRemotingViewerPluginMimeExtension,
220 kRemotingViewerPluginMimeDescription);
221 info.mime_types.push_back(remoting_mime_type);
222 info.internal_entry_points.get_interface = g_remoting_get_interface;
223 info.internal_entry_points.initialize_module = g_remoting_initialize_module;
224 info.internal_entry_points.shutdown_module = g_remoting_shutdown_module;
225 info.permissions = kRemotingViewerPluginPermissions;
227 plugins->push_back(info);
228 #endif
231 content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
232 const std::string& version) {
233 content::PepperPluginInfo plugin;
235 plugin.is_out_of_process = true;
236 plugin.name = content::kFlashPluginName;
237 plugin.path = path;
238 plugin.permissions = chrome::kPepperFlashPermissions;
240 std::vector<std::string> flash_version_numbers = base::SplitString(
241 version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
242 if (flash_version_numbers.size() < 1)
243 flash_version_numbers.push_back("11");
244 if (flash_version_numbers.size() < 2)
245 flash_version_numbers.push_back("2");
246 if (flash_version_numbers.size() < 3)
247 flash_version_numbers.push_back("999");
248 if (flash_version_numbers.size() < 4)
249 flash_version_numbers.push_back("999");
250 // E.g., "Shockwave Flash 10.2 r154":
251 plugin.description = plugin.name + " " + flash_version_numbers[0] + "." +
252 flash_version_numbers[1] + " r" + flash_version_numbers[2];
253 plugin.version = base::JoinString(flash_version_numbers, ".");
254 content::WebPluginMimeType swf_mime_type(content::kFlashPluginSwfMimeType,
255 content::kFlashPluginSwfExtension,
256 content::kFlashPluginSwfDescription);
257 plugin.mime_types.push_back(swf_mime_type);
258 content::WebPluginMimeType spl_mime_type(content::kFlashPluginSplMimeType,
259 content::kFlashPluginSplExtension,
260 content::kFlashPluginSplDescription);
261 plugin.mime_types.push_back(spl_mime_type);
263 return plugin;
266 void AddPepperFlashFromCommandLine(
267 std::vector<content::PepperPluginInfo>* plugins) {
268 const base::CommandLine::StringType flash_path =
269 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(
270 switches::kPpapiFlashPath);
271 if (flash_path.empty())
272 return;
274 // Also get the version from the command-line. Should be something like 11.2
275 // or 11.2.123.45.
276 std::string flash_version =
277 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
278 switches::kPpapiFlashVersion);
280 plugins->push_back(
281 CreatePepperFlashInfo(base::FilePath(flash_path), flash_version));
284 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin) {
285 #if defined(FLAPPER_AVAILABLE)
286 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
288 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the
289 // command-line.
290 if (command_line->HasSwitch(switches::kPpapiFlashPath))
291 return false;
293 bool force_disable =
294 command_line->HasSwitch(switches::kDisableBundledPpapiFlash);
295 if (force_disable)
296 return false;
298 base::FilePath flash_path;
299 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path))
300 return false;
302 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING);
303 return true;
304 #else
305 return false;
306 #endif // FLAPPER_AVAILABLE
309 #if defined(FLAPPER_AVAILABLE)
310 bool IsSystemFlashScriptDebuggerPresent() {
311 #if defined(OS_WIN)
312 const wchar_t kFlashRegistryRoot[] =
313 L"SOFTWARE\\Macromedia\\FlashPlayerPepper";
314 const wchar_t kIsDebuggerValueName[] = L"isScriptDebugger";
316 base::win::RegKey path_key(HKEY_LOCAL_MACHINE, kFlashRegistryRoot, KEY_READ);
317 DWORD debug_value;
318 if (FAILED(path_key.ReadValueDW(kIsDebuggerValueName, &debug_value)))
319 return false;
321 return (debug_value == 1);
322 #else
323 // TODO(wfh): implement this on OS X and Linux. crbug.com/497996.
324 return false;
325 #endif
327 #endif
329 bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
330 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
332 #if defined(FLAPPER_AVAILABLE)
333 // If flapper is available, only try the system plugin if either:
334 // --disable-bundled-ppapi-flash is specified, or the system debugger is the
335 // Flash Script Debugger.
336 if (!command_line->HasSwitch(switches::kDisableBundledPpapiFlash) &&
337 !IsSystemFlashScriptDebuggerPresent())
338 return false;
339 #endif // defined(FLAPPER_AVAILABLE)
341 // Do not try and find System Pepper Flash if there is a specific path on
342 // the commmand-line.
343 if (command_line->HasSwitch(switches::kPpapiFlashPath))
344 return false;
346 base::FilePath flash_filename;
347 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN,
348 &flash_filename))
349 return false;
351 if (!base::PathExists(flash_filename))
352 return false;
354 base::FilePath manifest_path(
355 flash_filename.DirName().AppendASCII("manifest.json"));
357 std::string manifest_data;
358 if (!base::ReadFileToString(manifest_path, &manifest_data))
359 return false;
360 scoped_ptr<base::Value> manifest_value(
361 base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS));
362 if (!manifest_value.get())
363 return false;
364 base::DictionaryValue* manifest = NULL;
365 if (!manifest_value->GetAsDictionary(&manifest))
366 return false;
368 Version version;
369 if (!chrome::CheckPepperFlashManifest(*manifest, &version))
370 return false;
372 *plugin = CreatePepperFlashInfo(flash_filename, version.GetString());
373 return true;
375 #endif // defined(ENABLE_PLUGINS)
377 std::string GetProduct() {
378 chrome::VersionInfo version_info;
379 return version_info.ProductNameAndVersionForUserAgent();
382 } // namespace
384 std::string GetUserAgent() {
385 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
386 if (command_line->HasSwitch(switches::kUserAgent)) {
387 std::string ua = command_line->GetSwitchValueASCII(switches::kUserAgent);
388 if (net::HttpUtil::IsValidHeaderValue(ua))
389 return ua;
390 LOG(WARNING) << "Ignored invalid value for flag --" << switches::kUserAgent;
393 std::string product = GetProduct();
394 #if defined(OS_ANDROID)
395 if (command_line->HasSwitch(switches::kUseMobileUserAgent))
396 product += " Mobile";
397 #endif
398 return content::BuildUserAgentFromProduct(product);
402 #if defined(ENABLE_REMOTING)
404 void ChromeContentClient::SetRemotingEntryFunctions(
405 content::PepperPluginInfo::GetInterfaceFunc get_interface,
406 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
407 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) {
408 g_remoting_get_interface = get_interface;
409 g_remoting_initialize_module = initialize_module;
410 g_remoting_shutdown_module = shutdown_module;
412 #endif
414 #if !defined(DISABLE_NACL)
415 void ChromeContentClient::SetNaClEntryFunctions(
416 content::PepperPluginInfo::GetInterfaceFunc get_interface,
417 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
418 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) {
419 g_nacl_get_interface = get_interface;
420 g_nacl_initialize_module = initialize_module;
421 g_nacl_shutdown_module = shutdown_module;
423 #endif
425 #if defined(ENABLE_PLUGINS)
426 void ChromeContentClient::SetPDFEntryFunctions(
427 content::PepperPluginInfo::GetInterfaceFunc get_interface,
428 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
429 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) {
430 g_pdf_get_interface = get_interface;
431 g_pdf_initialize_module = initialize_module;
432 g_pdf_shutdown_module = shutdown_module;
434 #endif
436 void ChromeContentClient::SetActiveURL(const GURL& url) {
437 base::debug::SetCrashKeyValue(crash_keys::kActiveURL,
438 url.possibly_invalid_spec());
441 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) {
442 #if !defined(OS_ANDROID)
443 base::debug::SetCrashKeyValue(crash_keys::kGPUVendorID,
444 base::StringPrintf("0x%04x", gpu_info.gpu.vendor_id));
445 base::debug::SetCrashKeyValue(crash_keys::kGPUDeviceID,
446 base::StringPrintf("0x%04x", gpu_info.gpu.device_id));
447 #endif
448 base::debug::SetCrashKeyValue(crash_keys::kGPUDriverVersion,
449 gpu_info.driver_version);
450 base::debug::SetCrashKeyValue(crash_keys::kGPUPixelShaderVersion,
451 gpu_info.pixel_shader_version);
452 base::debug::SetCrashKeyValue(crash_keys::kGPUVertexShaderVersion,
453 gpu_info.vertex_shader_version);
454 #if defined(OS_MACOSX)
455 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version);
456 #elif defined(OS_POSIX)
457 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor);
458 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer);
459 #endif
462 void ChromeContentClient::AddPepperPlugins(
463 std::vector<content::PepperPluginInfo>* plugins) {
464 #if defined(ENABLE_PLUGINS)
465 ComputeBuiltInPlugins(plugins);
466 AddPepperFlashFromCommandLine(plugins);
468 content::PepperPluginInfo plugin;
469 if (GetBundledPepperFlash(&plugin))
470 plugins->push_back(plugin);
471 if (GetSystemPepperFlash(&plugin))
472 plugins->push_back(plugin);
473 #endif
476 void ChromeContentClient::AddAdditionalSchemes(
477 std::vector<std::string>* standard_schemes,
478 std::vector<std::string>* savable_schemes) {
479 standard_schemes->push_back(extensions::kExtensionScheme);
480 savable_schemes->push_back(extensions::kExtensionScheme);
481 standard_schemes->push_back(chrome::kChromeNativeScheme);
482 standard_schemes->push_back(extensions::kExtensionResourceScheme);
483 savable_schemes->push_back(extensions::kExtensionResourceScheme);
484 standard_schemes->push_back(chrome::kChromeSearchScheme);
485 savable_schemes->push_back(chrome::kChromeSearchScheme);
486 standard_schemes->push_back(dom_distiller::kDomDistillerScheme);
487 savable_schemes->push_back(dom_distiller::kDomDistillerScheme);
488 #if defined(OS_CHROMEOS)
489 standard_schemes->push_back(chrome::kCrosScheme);
490 #endif
493 std::string ChromeContentClient::GetProduct() const {
494 return ::GetProduct();
497 std::string ChromeContentClient::GetUserAgent() const {
498 return ::GetUserAgent();
501 base::string16 ChromeContentClient::GetLocalizedString(int message_id) const {
502 return l10n_util::GetStringUTF16(message_id);
505 base::StringPiece ChromeContentClient::GetDataResource(
506 int resource_id,
507 ui::ScaleFactor scale_factor) const {
508 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
509 resource_id, scale_factor);
512 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes(
513 int resource_id) const {
514 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
517 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const {
518 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
521 std::string ChromeContentClient::GetProcessTypeNameInEnglish(int type) {
522 #if !defined(DISABLE_NACL)
523 switch (type) {
524 case PROCESS_TYPE_NACL_LOADER:
525 return "Native Client module";
526 case PROCESS_TYPE_NACL_BROKER:
527 return "Native Client broker";
529 #endif
531 NOTREACHED() << "Unknown child process type!";
532 return "Unknown";
535 #if defined(OS_MACOSX) && !defined(OS_IOS)
536 bool ChromeContentClient::GetSandboxProfileForSandboxType(
537 int sandbox_type,
538 int* sandbox_profile_resource_id) const {
539 DCHECK(sandbox_profile_resource_id);
540 #if !defined(DISABLE_NACL)
541 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) {
542 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE;
543 return true;
545 #endif
546 return false;
548 #endif
550 void ChromeContentClient::AddSecureSchemesAndOrigins(
551 std::set<std::string>* schemes,
552 std::set<GURL>* origins) {
553 schemes->insert(content::kChromeUIScheme);
554 schemes->insert(extensions::kExtensionScheme);
555 schemes->insert(extensions::kExtensionResourceScheme);
556 GetSecureOriginWhitelist(origins);
559 void ChromeContentClient::AddServiceWorkerSchemes(
560 std::set<std::string>* schemes) {
561 schemes->insert(extensions::kExtensionScheme);