Commit f482b59a authored by bbudge@chromium.org's avatar bbudge@chromium.org

Don't block the Native Client plug-in when plug-ins are blocked by content settings.

Instead, allow Native Client when Javascript is allowed.
BUG=91571
TEST=manual

Review URL: http://codereview.chromium.org/7978037

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102226 0039d316-1c4b-4281-b951-d872f2087c98
parent 232211d7
...@@ -391,9 +391,17 @@ WebPlugin* ChromeContentRendererClient::CreatePluginImpl( ...@@ -391,9 +391,17 @@ WebPlugin* ChromeContentRendererClient::CreatePluginImpl(
IDS_PLUGIN_NOT_AUTHORIZED, false, true); IDS_PLUGIN_NOT_AUTHORIZED, false, true);
} }
if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || // Treat Native Client invocations like Javascript.
plugin_setting == CONTENT_SETTING_ALLOW || bool is_nacl_plugin =
host_setting == CONTENT_SETTING_ALLOW) { 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) {
// Delay loading plugins if prerendering. // Delay loading plugins if prerendering.
if (prerender::PrerenderHelper::IsPrerendering(render_view)) { if (prerender::PrerenderHelper::IsPrerendering(render_view)) {
return CreatePluginPlaceholder( return CreatePluginPlaceholder(
...@@ -401,8 +409,8 @@ WebPlugin* ChromeContentRendererClient::CreatePluginImpl( ...@@ -401,8 +409,8 @@ WebPlugin* ChromeContentRendererClient::CreatePluginImpl(
IDS_PLUGIN_LOAD, true, true); IDS_PLUGIN_LOAD, true, true);
} }
// Enforce Chrome WebStore restriction on the Native Client plugin. // Enforce the Chrome WebStore restriction on the Native Client plugin.
if (info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) { if (is_nacl_plugin) {
bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl); bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl);
if (!allow_nacl) { if (!allow_nacl) {
const char* kNaClPluginMimeType = "application/x-nacl"; const char* kNaClPluginMimeType = "application/x-nacl";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment