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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 7978037: Don't block the Native Client plug-in when plug-ins are blocked by content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_content_renderer_client.cc
===================================================================
--- chrome/renderer/chrome_content_renderer_client.cc (revision 101981)
+++ chrome/renderer/chrome_content_renderer_client.cc (working copy)
@@ -391,9 +391,17 @@
IDS_PLUGIN_NOT_AUTHORIZED, false, true);
}
- if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName ||
- plugin_setting == CONTENT_SETTING_ALLOW ||
- host_setting == CONTENT_SETTING_ALLOW) {
+ // Treat Native Client invocations like Javascript.
+ bool is_nacl_plugin =
+ info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName);
+ if (is_nacl_plugin) {
+ plugin_setting =
+ observer->GetContentSetting(CONTENT_SETTINGS_TYPE_JAVASCRIPT);
+ }
+
+ if (plugin_setting == CONTENT_SETTING_ALLOW ||
+ host_setting == CONTENT_SETTING_ALLOW ||
+ info.path.value() == webkit::npapi::kDefaultPluginLibraryName) {
Bernhard Bauer 2011/09/23 08:26:08 Uh, if NaCl is blocked here, we will show the bloc
// Delay loading plugins if prerendering.
if (prerender::PrerenderHelper::IsPrerendering(render_view)) {
return CreatePluginPlaceholder(
@@ -401,8 +409,8 @@
IDS_PLUGIN_LOAD, true, true);
}
- // Enforce Chrome WebStore restriction on the Native Client plugin.
- if (info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) {
+ // Enforce the Chrome WebStore restriction on the Native Client plugin.
+ if (is_nacl_plugin) {
bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl);
if (!allow_nacl) {
const char* kNaClPluginMimeType = "application/x-nacl";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698