[Media Router] Add integration tests and e2e tests for media router and presentation...
[chromium-blink-merge.git] / chrome / common / chrome_content_client.cc
blobbbefaa0ca59d34162a272759ddab58cf9e041b05
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/render_messages.h"
27 #include "chrome/common/secure_origin_whitelist.h"
28 #include "chrome/common/url_constants.h"
29 #include "chrome/grit/common_resources.h"
30 #include "components/dom_distiller/core/url_constants.h"
31 #include "content/public/common/content_constants.h"
32 #include "content/public/common/content_switches.h"
33 #include "content/public/common/url_constants.h"
34 #include "content/public/common/user_agent.h"
35 #include "extensions/common/constants.h"
36 #include "gpu/config/gpu_info.h"
37 #include "net/http/http_util.h"
38 #include "ui/base/l10n/l10n_util.h"
39 #include "ui/base/layout.h"
40 #include "ui/base/resource/resource_bundle.h"
42 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
44 #if defined(OS_WIN)
45 #include "base/win/registry.h"
46 #include "base/win/windows_version.h"
47 #elif defined(OS_MACOSX)
48 #include "components/nacl/common/nacl_sandbox_type_mac.h"
49 #endif
51 #if !defined(DISABLE_NACL)
52 #include "components/nacl/common/nacl_constants.h"
53 #include "components/nacl/common/nacl_process_type.h"
54 #endif
56 #if defined(ENABLE_PLUGINS)
57 #include "chrome/common/pepper_flash.h"
58 #include "content/public/common/pepper_plugin_info.h"
59 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR.
60 #include "ppapi/shared_impl/ppapi_permissions.h"
61 #endif
63 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
64 !defined(WIDEVINE_CDM_IS_COMPONENT)
65 #include "chrome/common/widevine_cdm_constants.h"
66 #endif
68 namespace {
70 #if defined(ENABLE_PLUGINS)
71 const char kPDFPluginExtension[] = "pdf";
72 const char kPDFPluginDescription[] = "Portable Document Format";
73 const char kPDFPluginOutOfProcessMimeType[] =
74 "application/x-google-chrome-pdf";
75 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE |
76 ppapi::PERMISSION_DEV;
78 content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface;
79 content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module;
80 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_pdf_shutdown_module;
82 #if defined(ENABLE_REMOTING)
84 content::PepperPluginInfo::GetInterfaceFunc g_remoting_get_interface;
85 content::PepperPluginInfo::PPP_InitializeModuleFunc
86 g_remoting_initialize_module;
87 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_remoting_shutdown_module;
89 #if defined(GOOGLE_CHROME_BUILD)
90 const char kRemotingViewerPluginName[] = "Chrome Remote Desktop Viewer";
91 #else
92 const char kRemotingViewerPluginName[] = "Chromoting Viewer";
93 #endif // defined(GOOGLE_CHROME_BUILD)
94 const char kRemotingViewerPluginDescription[] =
95 "This plugin allows you to securely access other computers that have been "
96 "shared with you. To use this plugin you must first install the "
97 "<a href=\"https://chrome.google.com/remotedesktop\">"
98 "Chrome Remote Desktop</a> webapp.";
99 // Use a consistent MIME-type regardless of branding.
100 const char kRemotingViewerPluginMimeType[] =
101 "application/vnd.chromium.remoting-viewer";
102 const char kRemotingViewerPluginMimeExtension[] = "";
103 const char kRemotingViewerPluginMimeDescription[] = "";
104 const uint32 kRemotingViewerPluginPermissions = ppapi::PERMISSION_PRIVATE |
105 ppapi::PERMISSION_DEV;
106 #endif // defined(ENABLE_REMOTING)
108 #if !defined(DISABLE_NACL)
109 content::PepperPluginInfo::GetInterfaceFunc g_nacl_get_interface;
110 content::PepperPluginInfo::PPP_InitializeModuleFunc g_nacl_initialize_module;
111 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module;
112 #endif
114 // Appends the known built-in plugins to the given vector. Some built-in
115 // plugins are "internal" which means they are compiled into the Chrome binary,
116 // and some are extra shared libraries distributed with the browser (these are
117 // not marked internal, aside from being automatically registered, they're just
118 // regular plugins).
119 void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
120 content::PepperPluginInfo pdf_info;
121 pdf_info.is_internal = true;
122 pdf_info.is_out_of_process = true;
123 pdf_info.name = ChromeContentClient::kPDFPluginName;
124 pdf_info.description = kPDFPluginDescription;
125 pdf_info.path = base::FilePath::FromUTF8Unsafe(
126 ChromeContentClient::kPDFPluginPath);
127 content::WebPluginMimeType pdf_mime_type(
128 kPDFPluginOutOfProcessMimeType,
129 kPDFPluginExtension,
130 kPDFPluginDescription);
131 pdf_info.mime_types.push_back(pdf_mime_type);
132 pdf_info.internal_entry_points.get_interface = g_pdf_get_interface;
133 pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module;
134 pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module;
135 pdf_info.permissions = kPDFPluginPermissions;
136 plugins->push_back(pdf_info);
138 base::FilePath path;
140 #if !defined(DISABLE_NACL)
141 // Handle Native Client just like the PDF plugin. This means that it is
142 // enabled by default for the non-portable case. This allows apps installed
143 // from the Chrome Web Store to use NaCl even if the command line switch
144 // isn't set. For other uses of NaCl we check for the command line switch.
145 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) {
146 content::PepperPluginInfo nacl;
147 // The nacl plugin is now built into the Chromium binary.
148 nacl.is_internal = true;
149 nacl.path = path;
150 nacl.name = nacl::kNaClPluginName;
151 content::WebPluginMimeType nacl_mime_type(nacl::kNaClPluginMimeType,
152 nacl::kNaClPluginExtension,
153 nacl::kNaClPluginDescription);
154 nacl.mime_types.push_back(nacl_mime_type);
155 content::WebPluginMimeType pnacl_mime_type(nacl::kPnaclPluginMimeType,
156 nacl::kPnaclPluginExtension,
157 nacl::kPnaclPluginDescription);
158 nacl.mime_types.push_back(pnacl_mime_type);
159 nacl.internal_entry_points.get_interface = g_nacl_get_interface;
160 nacl.internal_entry_points.initialize_module = g_nacl_initialize_module;
161 nacl.internal_entry_points.shutdown_module = g_nacl_shutdown_module;
162 nacl.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV;
163 plugins->push_back(nacl);
165 #endif // !defined(DISABLE_NACL)
167 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
168 !defined(WIDEVINE_CDM_IS_COMPONENT)
169 static bool skip_widevine_cdm_file_check = false;
170 if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &path)) {
171 if (skip_widevine_cdm_file_check || base::PathExists(path)) {
172 content::PepperPluginInfo widevine_cdm;
173 widevine_cdm.is_out_of_process = true;
174 widevine_cdm.path = path;
175 widevine_cdm.name = kWidevineCdmDisplayName;
176 widevine_cdm.description = kWidevineCdmDescription +
177 std::string(" (version: ") +
178 WIDEVINE_CDM_VERSION_STRING + ")";
179 widevine_cdm.version = WIDEVINE_CDM_VERSION_STRING;
180 content::WebPluginMimeType widevine_cdm_mime_type(
181 kWidevineCdmPluginMimeType,
182 kWidevineCdmPluginExtension,
183 kWidevineCdmPluginMimeTypeDescription);
185 // Add the supported codecs as if they came from the component manifest.
186 std::vector<std::string> codecs;
187 codecs.push_back(kCdmSupportedCodecVorbis);
188 codecs.push_back(kCdmSupportedCodecVp8);
189 codecs.push_back(kCdmSupportedCodecVp9);
190 #if defined(USE_PROPRIETARY_CODECS)
191 codecs.push_back(kCdmSupportedCodecAac);
192 codecs.push_back(kCdmSupportedCodecAvc1);
193 #endif // defined(USE_PROPRIETARY_CODECS)
194 std::string codec_string =
195 JoinString(codecs, kCdmSupportedCodecsValueDelimiter);
196 widevine_cdm_mime_type.additional_param_names.push_back(
197 base::ASCIIToUTF16(kCdmSupportedCodecsParamName));
198 widevine_cdm_mime_type.additional_param_values.push_back(
199 base::ASCIIToUTF16(codec_string));
201 widevine_cdm.mime_types.push_back(widevine_cdm_mime_type);
202 widevine_cdm.permissions = kWidevineCdmPluginPermissions;
203 plugins->push_back(widevine_cdm);
205 skip_widevine_cdm_file_check = true;
208 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
209 // !defined(WIDEVINE_CDM_IS_COMPONENT)
211 // The Remoting Viewer plugin is built-in.
212 #if defined(ENABLE_REMOTING)
213 content::PepperPluginInfo info;
214 info.is_internal = true;
215 info.is_out_of_process = true;
216 info.name = kRemotingViewerPluginName;
217 info.description = kRemotingViewerPluginDescription;
218 info.path = base::FilePath::FromUTF8Unsafe(
219 ChromeContentClient::kRemotingViewerPluginPath);
220 content::WebPluginMimeType remoting_mime_type(
221 kRemotingViewerPluginMimeType,
222 kRemotingViewerPluginMimeExtension,
223 kRemotingViewerPluginMimeDescription);
224 info.mime_types.push_back(remoting_mime_type);
225 info.internal_entry_points.get_interface = g_remoting_get_interface;
226 info.internal_entry_points.initialize_module = g_remoting_initialize_module;
227 info.internal_entry_points.shutdown_module = g_remoting_shutdown_module;
228 info.permissions = kRemotingViewerPluginPermissions;
230 plugins->push_back(info);
231 #endif
234 content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
235 const std::string& version) {
236 content::PepperPluginInfo plugin;
238 plugin.is_out_of_process = true;
239 plugin.name = content::kFlashPluginName;
240 plugin.path = path;
241 plugin.permissions = chrome::kPepperFlashPermissions;
243 std::vector<std::string> flash_version_numbers;
244 base::SplitString(version, '.', &flash_version_numbers);
245 if (flash_version_numbers.size() < 1)
246 flash_version_numbers.push_back("11");
247 // |SplitString()| puts in an empty string given an empty string. :(
248 else if (flash_version_numbers[0].empty())
249 flash_version_numbers[0] = "11";
250 if (flash_version_numbers.size() < 2)
251 flash_version_numbers.push_back("2");
252 if (flash_version_numbers.size() < 3)
253 flash_version_numbers.push_back("999");
254 if (flash_version_numbers.size() < 4)
255 flash_version_numbers.push_back("999");
256 // E.g., "Shockwave Flash 10.2 r154":
257 plugin.description = plugin.name + " " + flash_version_numbers[0] + "." +
258 flash_version_numbers[1] + " r" + flash_version_numbers[2];
259 plugin.version = JoinString(flash_version_numbers, '.');
260 content::WebPluginMimeType swf_mime_type(content::kFlashPluginSwfMimeType,
261 content::kFlashPluginSwfExtension,
262 content::kFlashPluginSwfDescription);
263 plugin.mime_types.push_back(swf_mime_type);
264 content::WebPluginMimeType spl_mime_type(content::kFlashPluginSplMimeType,
265 content::kFlashPluginSplExtension,
266 content::kFlashPluginSplDescription);
267 plugin.mime_types.push_back(spl_mime_type);
269 return plugin;
272 void AddPepperFlashFromCommandLine(
273 std::vector<content::PepperPluginInfo>* plugins) {
274 const base::CommandLine::StringType flash_path =
275 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(
276 switches::kPpapiFlashPath);
277 if (flash_path.empty())
278 return;
280 // Also get the version from the command-line. Should be something like 11.2
281 // or 11.2.123.45.
282 std::string flash_version =
283 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
284 switches::kPpapiFlashVersion);
286 plugins->push_back(
287 CreatePepperFlashInfo(base::FilePath(flash_path), flash_version));
290 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin) {
291 #if defined(FLAPPER_AVAILABLE)
292 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
294 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the
295 // command-line.
296 if (command_line->HasSwitch(switches::kPpapiFlashPath))
297 return false;
299 bool force_disable =
300 command_line->HasSwitch(switches::kDisableBundledPpapiFlash);
301 if (force_disable)
302 return false;
304 base::FilePath flash_path;
305 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path))
306 return false;
308 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING);
309 return true;
310 #else
311 return false;
312 #endif // FLAPPER_AVAILABLE
315 #if defined(OS_WIN)
316 const char kPepperFlashDLLBaseName[] =
317 #if defined(ARCH_CPU_X86)
318 "pepflashplayer32_";
319 #elif defined(ARCH_CPU_X86_64)
320 "pepflashplayer64_";
321 #else
322 #error Unsupported Windows CPU architecture.
323 #endif // defined(ARCH_CPU_X86)
324 #endif // defined(OS_WIN)
326 bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
327 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
328 #if defined(FLAPPER_AVAILABLE)
329 // If flapper is available, only try system plugin if
330 // --disable-bundled-ppapi-flash is specified.
331 if (!command_line->HasSwitch(switches::kDisableBundledPpapiFlash))
332 return false;
333 #endif // defined(FLAPPER_AVAILABLE)
335 // Do not try and find System Pepper Flash if there is a specific path on
336 // the commmand-line.
337 if (command_line->HasSwitch(switches::kPpapiFlashPath))
338 return false;
340 base::FilePath flash_path;
341 if (!PathService::Get(chrome::DIR_PEPPER_FLASH_SYSTEM_PLUGIN, &flash_path))
342 return false;
344 if (!base::PathExists(flash_path))
345 return false;
347 base::FilePath manifest_path(flash_path.AppendASCII("manifest.json"));
349 std::string manifest_data;
350 if (!base::ReadFileToString(manifest_path, &manifest_data))
351 return false;
352 scoped_ptr<base::Value> manifest_value(
353 base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS));
354 if (!manifest_value.get())
355 return false;
356 base::DictionaryValue* manifest = NULL;
357 if (!manifest_value->GetAsDictionary(&manifest))
358 return false;
360 Version version;
361 if (!chrome::CheckPepperFlashManifest(*manifest, &version))
362 return false;
364 #if defined(OS_WIN)
365 // PepperFlash DLLs on Windows look like basename_v_x_y_z.dll.
366 std::string filename(kPepperFlashDLLBaseName);
367 filename.append(version.GetString());
368 base::ReplaceChars(filename, ".", "_", &filename);
369 filename.append(".dll");
371 base::FilePath path(flash_path.Append(base::ASCIIToUTF16(filename)));
372 #else
373 // PepperFlash on OS X is called PepperFlashPlayer.plugin
374 base::FilePath path(flash_path.Append(chrome::kPepperFlashPluginFilename));
375 #endif
377 if (!base::PathExists(path))
378 return false;
380 *plugin = CreatePepperFlashInfo(path, version.GetString());
381 return true;
383 #endif // defined(ENABLE_PLUGINS)
385 std::string GetProduct() {
386 chrome::VersionInfo version_info;
387 return version_info.ProductNameAndVersionForUserAgent();
390 } // namespace
392 std::string GetUserAgent() {
393 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
394 if (command_line->HasSwitch(switches::kUserAgent)) {
395 std::string ua = command_line->GetSwitchValueASCII(switches::kUserAgent);
396 if (net::HttpUtil::IsValidHeaderValue(ua))
397 return ua;
398 LOG(WARNING) << "Ignored invalid value for flag --" << switches::kUserAgent;
401 std::string product = GetProduct();
402 #if defined(OS_ANDROID)
403 if (command_line->HasSwitch(switches::kUseMobileUserAgent))
404 product += " Mobile";
405 #endif
406 return content::BuildUserAgentFromProduct(product);
410 #if defined(ENABLE_REMOTING)
412 void ChromeContentClient::SetRemotingEntryFunctions(
413 content::PepperPluginInfo::GetInterfaceFunc get_interface,
414 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
415 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) {
416 g_remoting_get_interface = get_interface;
417 g_remoting_initialize_module = initialize_module;
418 g_remoting_shutdown_module = shutdown_module;
420 #endif
422 #if !defined(DISABLE_NACL)
423 void ChromeContentClient::SetNaClEntryFunctions(
424 content::PepperPluginInfo::GetInterfaceFunc get_interface,
425 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
426 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) {
427 g_nacl_get_interface = get_interface;
428 g_nacl_initialize_module = initialize_module;
429 g_nacl_shutdown_module = shutdown_module;
431 #endif
433 #if defined(ENABLE_PLUGINS)
434 void ChromeContentClient::SetPDFEntryFunctions(
435 content::PepperPluginInfo::GetInterfaceFunc get_interface,
436 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
437 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) {
438 g_pdf_get_interface = get_interface;
439 g_pdf_initialize_module = initialize_module;
440 g_pdf_shutdown_module = shutdown_module;
442 #endif
444 void ChromeContentClient::SetActiveURL(const GURL& url) {
445 base::debug::SetCrashKeyValue(crash_keys::kActiveURL,
446 url.possibly_invalid_spec());
449 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) {
450 #if !defined(OS_ANDROID)
451 base::debug::SetCrashKeyValue(crash_keys::kGPUVendorID,
452 base::StringPrintf("0x%04x", gpu_info.gpu.vendor_id));
453 base::debug::SetCrashKeyValue(crash_keys::kGPUDeviceID,
454 base::StringPrintf("0x%04x", gpu_info.gpu.device_id));
455 #endif
456 base::debug::SetCrashKeyValue(crash_keys::kGPUDriverVersion,
457 gpu_info.driver_version);
458 base::debug::SetCrashKeyValue(crash_keys::kGPUPixelShaderVersion,
459 gpu_info.pixel_shader_version);
460 base::debug::SetCrashKeyValue(crash_keys::kGPUVertexShaderVersion,
461 gpu_info.vertex_shader_version);
462 #if defined(OS_MACOSX)
463 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version);
464 #elif defined(OS_POSIX)
465 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor);
466 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer);
467 #endif
470 void ChromeContentClient::AddPepperPlugins(
471 std::vector<content::PepperPluginInfo>* plugins) {
472 #if defined(ENABLE_PLUGINS)
473 ComputeBuiltInPlugins(plugins);
474 AddPepperFlashFromCommandLine(plugins);
476 content::PepperPluginInfo plugin;
477 if (GetBundledPepperFlash(&plugin))
478 plugins->push_back(plugin);
479 if (GetSystemPepperFlash(&plugin))
480 plugins->push_back(plugin);
481 #endif
484 void ChromeContentClient::AddAdditionalSchemes(
485 std::vector<std::string>* standard_schemes,
486 std::vector<std::string>* savable_schemes) {
487 standard_schemes->push_back(extensions::kExtensionScheme);
488 savable_schemes->push_back(extensions::kExtensionScheme);
489 standard_schemes->push_back(chrome::kChromeNativeScheme);
490 standard_schemes->push_back(extensions::kExtensionResourceScheme);
491 savable_schemes->push_back(extensions::kExtensionResourceScheme);
492 standard_schemes->push_back(chrome::kChromeSearchScheme);
493 savable_schemes->push_back(chrome::kChromeSearchScheme);
494 standard_schemes->push_back(dom_distiller::kDomDistillerScheme);
495 savable_schemes->push_back(dom_distiller::kDomDistillerScheme);
496 #if defined(OS_CHROMEOS)
497 standard_schemes->push_back(chrome::kCrosScheme);
498 #endif
501 std::string ChromeContentClient::GetProduct() const {
502 return ::GetProduct();
505 std::string ChromeContentClient::GetUserAgent() const {
506 return ::GetUserAgent();
509 base::string16 ChromeContentClient::GetLocalizedString(int message_id) const {
510 return l10n_util::GetStringUTF16(message_id);
513 base::StringPiece ChromeContentClient::GetDataResource(
514 int resource_id,
515 ui::ScaleFactor scale_factor) const {
516 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
517 resource_id, scale_factor);
520 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes(
521 int resource_id) const {
522 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
525 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const {
526 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
529 std::string ChromeContentClient::GetProcessTypeNameInEnglish(int type) {
530 #if !defined(DISABLE_NACL)
531 switch (type) {
532 case PROCESS_TYPE_NACL_LOADER:
533 return "Native Client module";
534 case PROCESS_TYPE_NACL_BROKER:
535 return "Native Client broker";
537 #endif
539 NOTREACHED() << "Unknown child process type!";
540 return "Unknown";
543 #if defined(OS_MACOSX) && !defined(OS_IOS)
544 bool ChromeContentClient::GetSandboxProfileForSandboxType(
545 int sandbox_type,
546 int* sandbox_profile_resource_id) const {
547 DCHECK(sandbox_profile_resource_id);
548 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) {
549 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE;
550 return true;
552 return false;
554 #endif
556 void ChromeContentClient::AddSecureSchemesAndOrigins(
557 std::set<std::string>* schemes,
558 std::set<GURL>* origins) {
559 schemes->insert(content::kChromeUIScheme);
560 schemes->insert(extensions::kExtensionScheme);
561 schemes->insert(extensions::kExtensionResourceScheme);
562 GetSecureOriginWhitelist(origins);