summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 19:14:24 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 19:14:24 +0000
commit1d8994b58c736cf85b8837b99bb80d274b968409 (patch)
treef76b94100ef4f8fc9e321958e00e1c43e0a73996 /chrome/common
parent17dfaea4281f67dddd5d052b1d90c513506568a5 (diff)
downloadchromium_src-1d8994b58c736cf85b8837b99bb80d274b968409.zip
chromium_src-1d8994b58c736cf85b8837b99bb80d274b968409.tar.gz
chromium_src-1d8994b58c736cf85b8837b99bb80d274b968409.tar.bz2
Update pepper registry of internal plugins.
Added constants for NaCl. Register plugin (only if --enable-nacl) BUG= http://code.google.com/p/nativeclient/issues/detail?id=933 TEST=none Original patch by Noel Allen. Review URL: http://codereview.chromium.org/5848001/ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/pepper_plugin_registry.cc29
-rw-r--r--chrome/common/pepper_plugin_registry.h5
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