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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 8334020: Check for default content setting pattern when requiring user authorization for plug-ins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 2 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 | « chrome/common/render_messages.cc ('k') | chrome/renderer/content_settings_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 79f9d775c52c7356e2d0ef6a5cf0db97c98e25bb..1a5e70863a653dba3c2bc40faff09eabcae21f6e 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -16,6 +16,7 @@
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/content_settings_pattern.h"
#include "chrome/common/external_ipc_fuzzer.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -340,8 +341,11 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
ContentSettingsType content_type = CONTENT_SETTINGS_TYPE_PLUGINS;
ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT;
std::string resource = group->identifier();
+ ContentSettingsPattern primary_pattern;
+ ContentSettingsPattern secondary_pattern;
render_view->Send(new ChromeViewHostMsg_GetPluginContentSetting(
- frame->top()->document().url(), resource, &plugin_setting));
+ frame->top()->document().url(), resource,
+ &plugin_setting, &primary_pattern, &secondary_pattern));
DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT);
WebPluginParams params(original_params);
@@ -383,14 +387,14 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
}
ContentSettingsObserver* observer = ContentSettingsObserver::Get(render_view);
- ContentSetting host_setting =
- observer->GetContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS);
+ ContentSettingsPattern wildcard = ContentSettingsPattern::Wildcard();
if (group->RequiresAuthorization(plugin) &&
authorize_policy == CONTENT_SETTING_ASK &&
- (plugin_setting == CONTENT_SETTING_ALLOW ||
- plugin_setting == CONTENT_SETTING_ASK) &&
- host_setting == CONTENT_SETTING_DEFAULT) {
+ plugin_setting != CONTENT_SETTING_BLOCK &&
+ primary_pattern == wildcard &&
+ secondary_pattern == wildcard &&
+ !observer->plugins_temporarily_allowed()) {
render_view->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin(
render_view->GetRoutingId(), group->GetGroupName(), GURL()));
return CreatePluginPlaceholder(
@@ -408,7 +412,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
}
if (plugin_setting == CONTENT_SETTING_ALLOW ||
- host_setting == CONTENT_SETTING_ALLOW ||
+ observer->plugins_temporarily_allowed() ||
plugin.path.value() == webkit::npapi::kDefaultPluginLibraryName) {
// Delay loading plugins if prerendering.
if (prerender::PrerenderHelper::IsPrerendering(render_view)) {
« no previous file with comments | « chrome/common/render_messages.cc ('k') | chrome/renderer/content_settings_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698