OLD | NEW |
---|---|
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 "chrome/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #endif // defined(OS_LINUX) | 9 #endif // defined(OS_LINUX) |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 content::PepperPluginInfo::PPP_InitializeModuleFunc g_nacl_initialize_module; | 90 content::PepperPluginInfo::PPP_InitializeModuleFunc g_nacl_initialize_module; |
91 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module; | 91 content::PepperPluginInfo::PPP_ShutdownModuleFunc g_nacl_shutdown_module; |
92 #endif | 92 #endif |
93 | 93 |
94 // Appends the known built-in plugins to the given vector. Some built-in | 94 // Appends the known built-in plugins to the given vector. Some built-in |
95 // plugins are "internal" which means they are compiled into the Chrome binary, | 95 // plugins are "internal" which means they are compiled into the Chrome binary, |
96 // and some are extra shared libraries distributed with the browser (these are | 96 // and some are extra shared libraries distributed with the browser (these are |
97 // not marked internal, aside from being automatically registered, they're just | 97 // not marked internal, aside from being automatically registered, they're just |
98 // regular plugins). | 98 // regular plugins). |
99 void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { | 99 void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { |
100 #if !defined(OS_ANDROID) | |
Nico
2015/08/28 19:25:13
Should this be some ENABLE_ define too, based on t
hshi1
2015/08/28 20:33:55
In offline discussion bauberb@ suggested to add an
| |
100 content::PepperPluginInfo pdf_info; | 101 content::PepperPluginInfo pdf_info; |
101 pdf_info.is_internal = true; | 102 pdf_info.is_internal = true; |
102 pdf_info.is_out_of_process = true; | 103 pdf_info.is_out_of_process = true; |
103 pdf_info.name = ChromeContentClient::kPDFPluginName; | 104 pdf_info.name = ChromeContentClient::kPDFPluginName; |
104 pdf_info.description = kPDFPluginDescription; | 105 pdf_info.description = kPDFPluginDescription; |
105 pdf_info.path = base::FilePath::FromUTF8Unsafe( | 106 pdf_info.path = base::FilePath::FromUTF8Unsafe( |
106 ChromeContentClient::kPDFPluginPath); | 107 ChromeContentClient::kPDFPluginPath); |
107 content::WebPluginMimeType pdf_mime_type( | 108 content::WebPluginMimeType pdf_mime_type( |
108 kPDFPluginOutOfProcessMimeType, | 109 kPDFPluginOutOfProcessMimeType, |
109 kPDFPluginExtension, | 110 kPDFPluginExtension, |
110 kPDFPluginDescription); | 111 kPDFPluginDescription); |
111 pdf_info.mime_types.push_back(pdf_mime_type); | 112 pdf_info.mime_types.push_back(pdf_mime_type); |
112 pdf_info.internal_entry_points.get_interface = g_pdf_get_interface; | 113 pdf_info.internal_entry_points.get_interface = g_pdf_get_interface; |
113 pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module; | 114 pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module; |
114 pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module; | 115 pdf_info.internal_entry_points.shutdown_module = g_pdf_shutdown_module; |
115 pdf_info.permissions = kPDFPluginPermissions; | 116 pdf_info.permissions = kPDFPluginPermissions; |
116 plugins->push_back(pdf_info); | 117 plugins->push_back(pdf_info); |
118 #endif // !defined(OS_ANDROID) | |
117 | 119 |
118 base::FilePath path; | 120 base::FilePath path; |
119 | 121 |
120 #if !defined(DISABLE_NACL) | 122 #if !defined(DISABLE_NACL) |
121 // Handle Native Client just like the PDF plugin. This means that it is | 123 // Handle Native Client just like the PDF plugin. This means that it is |
122 // enabled by default for the non-portable case. This allows apps installed | 124 // enabled by default for the non-portable case. This allows apps installed |
123 // from the Chrome Web Store to use NaCl even if the command line switch | 125 // from the Chrome Web Store to use NaCl even if the command line switch |
124 // isn't set. For other uses of NaCl we check for the command line switch. | 126 // isn't set. For other uses of NaCl we check for the command line switch. |
125 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { | 127 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { |
126 content::PepperPluginInfo nacl; | 128 content::PepperPluginInfo nacl; |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
599 schemes->insert(content::kChromeUIScheme); | 601 schemes->insert(content::kChromeUIScheme); |
600 schemes->insert(extensions::kExtensionScheme); | 602 schemes->insert(extensions::kExtensionScheme); |
601 schemes->insert(extensions::kExtensionResourceScheme); | 603 schemes->insert(extensions::kExtensionResourceScheme); |
602 GetSecureOriginWhitelist(origins); | 604 GetSecureOriginWhitelist(origins); |
603 } | 605 } |
604 | 606 |
605 void ChromeContentClient::AddServiceWorkerSchemes( | 607 void ChromeContentClient::AddServiceWorkerSchemes( |
606 std::set<std::string>* schemes) { | 608 std::set<std::string>* schemes) { |
607 schemes->insert(extensions::kExtensionScheme); | 609 schemes->insert(extensions::kExtensionScheme); |
608 } | 610 } |
OLD | NEW |