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