diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/common/pepper_plugin_registry.cc | 29 | ||||
-rw-r--r-- | chrome/common/pepper_plugin_registry.h | 5 |
2 files changed, 34 insertions, 0 deletions
diff --git a/chrome/common/pepper_plugin_registry.cc b/chrome/common/pepper_plugin_registry.cc index a9d979f..22dc978 100644 --- a/chrome/common/pepper_plugin_registry.cc +++ b/chrome/common/pepper_plugin_registry.cc @@ -21,6 +21,14 @@ const char* PepperPluginRegistry::kPDFPluginExtension = "pdf"; const char* PepperPluginRegistry::kPDFPluginDescription = "Portable Document Format"; +const char* PepperPluginRegistry::kNaClPluginName = "Chrome NaCl"; +const char* PepperPluginRegistry::kNaClPluginMimeType = + "application/x-ppapi-nacl-srpc"; +const char* PepperPluginRegistry::kNaClPluginExtension = "nexe"; +const char* PepperPluginRegistry::kNaClPluginDescription = + "Native Client Executable"; + + PepperPluginInfo::PepperPluginInfo() : is_internal(false), is_out_of_process(false) { @@ -140,6 +148,27 @@ void PepperPluginRegistry::GetExtraPlugins( skip_pdf_file_check = true; } } + + // Verify that we enable nacl on the command line. The name of the + // switch varies between the browser and renderer process. + bool enable_nacl = + CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaCl) || + CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl); + + static bool skip_nacl_file_check = false; + if (enable_nacl && PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { + if (skip_nacl_file_check || file_util::PathExists(path)) { + PepperPluginInfo nacl; + nacl.path = path; + nacl.name = kNaClPluginName; + nacl.mime_types.push_back(kNaClPluginMimeType); + nacl.file_extensions = kNaClPluginExtension; + nacl.type_descriptions = kNaClPluginDescription; + plugins->push_back(nacl); + + skip_nacl_file_check = true; + } + } } PepperPluginRegistry::InternalPluginInfo::InternalPluginInfo() { diff --git a/chrome/common/pepper_plugin_registry.h b/chrome/common/pepper_plugin_registry.h index 60762c5b..a9285b9 100644 --- a/chrome/common/pepper_plugin_registry.h +++ b/chrome/common/pepper_plugin_registry.h @@ -40,6 +40,11 @@ class PepperPluginRegistry { static const char* kPDFPluginExtension; static const char* kPDFPluginDescription; + static const char* kNaClPluginName; + static const char* kNaClPluginMimeType; + static const char* kNaClPluginExtension; + static const char* kNaClPluginDescription; + static PepperPluginRegistry* GetInstance(); // Returns the list of known pepper plugins. This method is static so that |