Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6799)

Unified Diff: chrome/common/chrome_content_client.cc

Issue 16296005: Split pnacl and nacl mime types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: After (hopefully) last rebase. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_content_client.cc
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 13a2069e4b86d3b65a607ce4b0c987cdd21a8321..e60f06d5c7e8da4edf68a6f9579174a70a12fe6b 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -65,11 +65,17 @@ const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_DEV;
const char kNaClPluginMimeType[] = "application/x-nacl";
-const char kNaClPluginExtension[] = "nexe";
+const char kNaClPluginExtension[] = "";
const char kNaClPluginDescription[] = "Native Client Executable";
const uint32 kNaClPluginPermissions = ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_DEV;
+const char kPnaclPluginMimeType[] = "application/x-pnacl";
+const char kPnaclPluginExtension[] = "";
+const char kPnaclPluginDescription[] = "Portable Native Client Executable";
+const uint32 kPnaclPluginPermissions = ppapi::PERMISSION_PRIVATE |
+ ppapi::PERMISSION_DEV;
+
const char kO3DPluginName[] = "Google Talk Plugin Video Accelerator";
const char kO3DPluginMimeType[] ="application/vnd.o3d.auto";
const char kO3DPluginExtension[] = "";
@@ -151,10 +157,12 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
}
}
- // Handle the Native Client just like the PDF plugin. This means that it is
- // enabled by default. This allows apps installed from the Chrome Web Store
- // to use NaCl even if the command line switch isn't set. For other uses of
- // NaCl we check for the command line switch.
+ // Handle Native Client just like the PDF plugin. This means that it is
+ // enabled by default for the non-portable case. This allows apps installed
+ // from the Chrome Web Store to use NaCl even if the command line switch
+ // isn't set. For other uses of NaCl we check for the command line switch.
+ // Specifically, Portable Native Client is only enabled by the command line
+ // switch.
static bool skip_nacl_file_check = false;
if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) {
if (skip_nacl_file_check || file_util::PathExists(path)) {
@@ -165,6 +173,12 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
kNaClPluginExtension,
kNaClPluginDescription);
nacl.mime_types.push_back(nacl_mime_type);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePnacl)) {
+ webkit::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType,
+ kPnaclPluginExtension,
+ kPnaclPluginDescription);
+ nacl.mime_types.push_back(pnacl_mime_type);
+ }
nacl.permissions = kNaClPluginPermissions;
plugins->push_back(nacl);
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698