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

Unified Diff: chrome/browser/content_settings/content_settings_policy_provider.cc

Issue 7831004: Add a method to the content_settings::ProviderInterface to return the content settings Value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/content_settings/content_settings_policy_provider.cc
diff --git a/chrome/browser/content_settings/content_settings_policy_provider.cc b/chrome/browser/content_settings/content_settings_policy_provider.cc
index 4b135b8c867d52d407f219ebd75f312021a7541e..bc4b7e98f26a29c35cffe2b57bdad5ecd3821aa5 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider.cc
+++ b/chrome/browser/content_settings/content_settings_policy_provider.cc
@@ -391,10 +391,10 @@ ContentSetting PolicyProvider::GetContentSetting(
const ResourceIdentifier& resource_identifier) const {
// Resource identifier are not supported by policies as long as the feature is
// behind a flag. So resource identifiers are simply ignored.
- Value* value = value_map_.GetValue(primary_url,
- secondary_url,
- content_type,
- resource_identifier);
+ Value* value = GetContentSettingValue(primary_url,
+ secondary_url,
+ content_type,
+ resource_identifier);
Bernhard Bauer 2011/09/01 13:33:19 Nit: indent
markusheintz_ 2011/09/01 14:32:49 Done.
ContentSetting setting =
value == NULL ? CONTENT_SETTING_DEFAULT : ValueToContentSetting(value);
if (setting == CONTENT_SETTING_DEFAULT && default_provider_)
@@ -402,6 +402,22 @@ ContentSetting PolicyProvider::GetContentSetting(
return setting;
}
+Value* PolicyProvider::GetContentSettingValue(
+ const GURL& primary_url,
+ const GURL& secondary_url,
+ ContentSettingsType content_type,
+ const ResourceIdentifier& resource_identifier) const {
+ // Resource identifier are not supported by policies as long as the feature is
+ // behind a flag. So resource identifiers are simply ignored.
+ Value* value = value_map_.GetValue(primary_url,
+ secondary_url,
+ content_type,
+ resource_identifier);
+ return value ? value->DeepCopy() : NULL;
+}
+
+
+
void PolicyProvider::GetAllContentSettingsRules(
ContentSettingsType content_type,
const ResourceIdentifier& resource_identifier,

Powered by Google App Engine
This is Rietveld 408576698