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

Unified Diff: chrome/browser/renderer_host/chrome_render_message_filter.cc

Issue 8356010: Merge 106270 - Check for default content settings when requiring user authorization for plug-ins. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/912/src
Patch Set: fix 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
Index: chrome/browser/renderer_host/chrome_render_message_filter.cc
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index ce27cd4cf351bad4da6206568c4bbb44f7e953d4..0a0f914d95b0bcf3f80397097c69f7053d95d722 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -9,6 +9,7 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/automation/automation_resource_message_filter.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/extensions/extension_event_router.h"
@@ -490,13 +491,19 @@ void ChromeRenderMessageFilter::OnAllowIndexedDB(int render_view_id,
void ChromeRenderMessageFilter::OnGetPluginContentSetting(
const GURL& policy_url,
const std::string& resource,
- ContentSetting* setting) {
- *setting = host_content_settings_map_->GetContentSetting(
- policy_url, policy_url, CONTENT_SETTINGS_TYPE_PLUGINS, resource);
- if (*setting == CONTENT_SETTING_DEFAULT) {
- *setting = host_content_settings_map_->GetContentSetting(
- policy_url, policy_url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string());
+ ContentSetting* setting,
+ ContentSettingsPattern* primary_pattern,
+ ContentSettingsPattern* secondary_pattern) {
+ scoped_ptr<base::Value> value(
+ host_content_settings_map_->GetContentSettingValue(
+ policy_url, policy_url, CONTENT_SETTINGS_TYPE_PLUGINS, resource,
+ primary_pattern, secondary_pattern));
+ if (!value.get()) {
+ value.reset(host_content_settings_map_->GetContentSettingValue(
+ policy_url, policy_url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string(),
+ primary_pattern, secondary_pattern));
}
+ *setting = content_settings::ValueToContentSetting(value.get());
}
struct ChromeRenderMessageFilter::GetPluginInfo_Params {
« no previous file with comments | « chrome/browser/renderer_host/chrome_render_message_filter.h ('k') | chrome/browser/tab_contents/tab_contents_ssl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698