summaryrefslogtreecommitdiffstats
path: root/chrome/common/pepper_plugin_registry.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/pepper_plugin_registry.cc')
-rw-r--r--chrome/common/pepper_plugin_registry.cc29
1 files changed, 29 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() {