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 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/cpu.h" | 8 #include "base/cpu.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. | 41 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. |
42 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 42 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
43 | 43 |
44 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
45 #include "base/win/registry.h" | 45 #include "base/win/registry.h" |
46 #include "base/win/windows_version.h" | 46 #include "base/win/windows_version.h" |
47 #elif defined(OS_MACOSX) | 47 #elif defined(OS_MACOSX) |
48 #include "components/nacl/common/nacl_sandbox_type_mac.h" | 48 #include "components/nacl/common/nacl_sandbox_type_mac.h" |
49 #endif | 49 #endif |
50 | 50 |
51 #if !defined(DISABLE_NACL) | |
52 #include "ppapi/native_client/src/trusted/plugin/ppapi_entrypoints.h" | |
53 #endif | |
54 | |
51 #if defined(ENABLE_REMOTING) | 55 #if defined(ENABLE_REMOTING) |
52 #include "remoting/client/plugin/pepper_entrypoints.h" | 56 #include "remoting/client/plugin/pepper_entrypoints.h" |
53 #endif | 57 #endif |
54 | 58 |
55 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \ | 59 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \ |
56 !defined(WIDEVINE_CDM_IS_COMPONENT) | 60 !defined(WIDEVINE_CDM_IS_COMPONENT) |
57 #include "chrome/common/widevine_cdm_constants.h" | 61 #include "chrome/common/widevine_cdm_constants.h" |
58 #endif | 62 #endif |
59 | 63 |
60 namespace { | 64 namespace { |
61 | 65 |
62 const char kPDFPluginMimeType[] = "application/pdf"; | 66 const char kPDFPluginMimeType[] = "application/pdf"; |
63 const char kPDFPluginExtension[] = "pdf"; | 67 const char kPDFPluginExtension[] = "pdf"; |
64 const char kPDFPluginDescription[] = "Portable Document Format"; | 68 const char kPDFPluginDescription[] = "Portable Document Format"; |
65 const char kPDFPluginPrintPreviewMimeType[] = | 69 const char kPDFPluginPrintPreviewMimeType[] = |
66 "application/x-google-chrome-print-preview-pdf"; | 70 "application/x-google-chrome-print-preview-pdf"; |
67 const char kPDFPluginOutOfProcessMimeType[] = | 71 const char kPDFPluginOutOfProcessMimeType[] = |
68 "application/x-google-chrome-pdf"; | 72 "application/x-google-chrome-pdf"; |
69 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | | 73 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | |
70 ppapi::PERMISSION_DEV; | 74 ppapi::PERMISSION_DEV; |
71 | 75 |
76 #if !defined(DISABLE_NACL) | |
72 const char kNaClPluginMimeType[] = "application/x-nacl"; | 77 const char kNaClPluginMimeType[] = "application/x-nacl"; |
73 const char kNaClPluginExtension[] = ""; | 78 const char kNaClPluginExtension[] = ""; |
74 const char kNaClPluginDescription[] = "Native Client Executable"; | 79 const char kNaClPluginDescription[] = "Native Client Executable"; |
75 const uint32 kNaClPluginPermissions = ppapi::PERMISSION_PRIVATE | | 80 const uint32 kNaClPluginPermissions = ppapi::PERMISSION_PRIVATE | |
76 ppapi::PERMISSION_DEV; | 81 ppapi::PERMISSION_DEV; |
77 | 82 |
78 const char kPnaclPluginMimeType[] = "application/x-pnacl"; | 83 const char kPnaclPluginMimeType[] = "application/x-pnacl"; |
79 const char kPnaclPluginExtension[] = ""; | 84 const char kPnaclPluginExtension[] = ""; |
80 const char kPnaclPluginDescription[] = "Portable Native Client Executable"; | 85 const char kPnaclPluginDescription[] = "Portable Native Client Executable"; |
86 #endif // !defined(DISABLE_NACL) | |
81 | 87 |
82 const char kO1DPluginName[] = "Google Talk Plugin Video Renderer"; | 88 const char kO1DPluginName[] = "Google Talk Plugin Video Renderer"; |
83 const char kO1DPluginMimeType[] ="application/o1d"; | 89 const char kO1DPluginMimeType[] ="application/o1d"; |
84 const char kO1DPluginExtension[] = ""; | 90 const char kO1DPluginExtension[] = ""; |
85 const char kO1DPluginDescription[] = "Google Talk Plugin Video Renderer"; | 91 const char kO1DPluginDescription[] = "Google Talk Plugin Video Renderer"; |
86 const uint32 kO1DPluginPermissions = ppapi::PERMISSION_PRIVATE | | 92 const uint32 kO1DPluginPermissions = ppapi::PERMISSION_PRIVATE | |
87 ppapi::PERMISSION_DEV; | 93 ppapi::PERMISSION_DEV; |
88 | 94 |
89 const char kEffectsPluginName[] = "Google Talk Effects Plugin"; | 95 const char kEffectsPluginName[] = "Google Talk Effects Plugin"; |
90 const char kEffectsPluginMimeType[] ="application/x-ppapi-hangouts-effects"; | 96 const char kEffectsPluginMimeType[] ="application/x-ppapi-hangouts-effects"; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 pdf.mime_types.push_back(pdf_mime_type); | 164 pdf.mime_types.push_back(pdf_mime_type); |
159 pdf.mime_types.push_back(print_preview_pdf_mime_type); | 165 pdf.mime_types.push_back(print_preview_pdf_mime_type); |
160 } | 166 } |
161 pdf.permissions = kPDFPluginPermissions; | 167 pdf.permissions = kPDFPluginPermissions; |
162 plugins->push_back(pdf); | 168 plugins->push_back(pdf); |
163 | 169 |
164 skip_pdf_file_check = true; | 170 skip_pdf_file_check = true; |
165 } | 171 } |
166 } | 172 } |
167 | 173 |
174 #if !defined(DISABLE_NACL) | |
168 // Handle Native Client just like the PDF plugin. This means that it is | 175 // Handle Native Client just like the PDF plugin. This means that it is |
169 // enabled by default for the non-portable case. This allows apps installed | 176 // enabled by default for the non-portable case. This allows apps installed |
170 // from the Chrome Web Store to use NaCl even if the command line switch | 177 // from the Chrome Web Store to use NaCl even if the command line switch |
171 // isn't set. For other uses of NaCl we check for the command line switch. | 178 // isn't set. For other uses of NaCl we check for the command line switch. |
172 static bool skip_nacl_file_check = false; | 179 // Specifically, Portable Native Client is only enabled by the command line |
Mark Seaborn
2014/07/28 20:28:36
You don't mean this, surely? PNaCl is enabled by
teravest
2014/07/28 22:04:21
Sorry, looks like I had a bad rebase and this got
| |
180 // switch. | |
173 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { | 181 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { |
174 if (skip_nacl_file_check || base::PathExists(path)) { | 182 content::PepperPluginInfo nacl; |
175 content::PepperPluginInfo nacl; | 183 // The nacl plugin is now built into the Chromium binary. |
176 nacl.path = path; | 184 nacl.is_internal = true; |
177 nacl.name = ChromeContentClient::kNaClPluginName; | 185 nacl.path = path; |
178 content::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, | 186 nacl.name = ChromeContentClient::kNaClPluginName; |
179 kNaClPluginExtension, | 187 content::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, |
180 kNaClPluginDescription); | 188 kNaClPluginExtension, |
181 nacl.mime_types.push_back(nacl_mime_type); | 189 kNaClPluginDescription); |
182 content::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType, | 190 nacl.mime_types.push_back(nacl_mime_type); |
183 kPnaclPluginExtension, | 191 content::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType, |
184 kPnaclPluginDescription); | 192 kPnaclPluginExtension, |
185 nacl.mime_types.push_back(pnacl_mime_type); | 193 kPnaclPluginDescription); |
186 nacl.permissions = kNaClPluginPermissions; | 194 nacl.mime_types.push_back(pnacl_mime_type); |
187 plugins->push_back(nacl); | 195 nacl.internal_entry_points.get_interface = nacl_plugin::PPP_GetInterface; |
188 | 196 nacl.internal_entry_points.initialize_module = |
189 skip_nacl_file_check = true; | 197 nacl_plugin::PPP_InitializeModule; |
190 } | 198 nacl.internal_entry_points.shutdown_module = |
199 nacl_plugin::PPP_ShutdownModule; | |
200 nacl.permissions = kNaClPluginPermissions; | |
201 plugins->push_back(nacl); | |
191 } | 202 } |
203 #endif // !defined(DISABLE_NACL) | |
192 | 204 |
193 static bool skip_o1d_file_check = false; | 205 static bool skip_o1d_file_check = false; |
194 if (PathService::Get(chrome::FILE_O1D_PLUGIN, &path)) { | 206 if (PathService::Get(chrome::FILE_O1D_PLUGIN, &path)) { |
195 if (skip_o1d_file_check || base::PathExists(path)) { | 207 if (skip_o1d_file_check || base::PathExists(path)) { |
196 content::PepperPluginInfo o1d; | 208 content::PepperPluginInfo o1d; |
197 o1d.path = path; | 209 o1d.path = path; |
198 o1d.name = kO1DPluginName; | 210 o1d.name = kO1DPluginName; |
199 o1d.is_out_of_process = true; | 211 o1d.is_out_of_process = true; |
200 o1d.is_sandboxed = false; | 212 o1d.is_sandboxed = false; |
201 o1d.permissions = kO1DPluginPermissions; | 213 o1d.permissions = kO1DPluginPermissions; |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
527 int sandbox_type, | 539 int sandbox_type, |
528 int* sandbox_profile_resource_id) const { | 540 int* sandbox_profile_resource_id) const { |
529 DCHECK(sandbox_profile_resource_id); | 541 DCHECK(sandbox_profile_resource_id); |
530 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { | 542 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { |
531 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 543 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
532 return true; | 544 return true; |
533 } | 545 } |
534 return false; | 546 return false; |
535 } | 547 } |
536 #endif | 548 #endif |
OLD | NEW |