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

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

Issue 7828022: Add a method to the HostContentSettings map to return the |Value| of a content setting (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/host_content_settings_map.cc
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index 16ad3a22d66fa5b1d1767958a305407092dec33f..949b6025c60b121e999d7e41551fc05993706c4e 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -231,6 +231,32 @@ ContentSetting HostContentSettingsMap::GetContentSetting(
primary_url, secondary_url, content_type, resource_identifier);
}
+Value* HostContentSettingsMap::GetContentSettingValue(
+ const GURL& primary_url,
+ const GURL& secondary_url,
+ ContentSettingsType content_type,
+ const std::string& resource_identifier) const {
+ if (ShouldAllowAllContent(secondary_url, content_type))
+ return Value::CreateIntegerValue(CONTENT_SETTING_ALLOW);
+
+ // Iterate through the list of providers and break when the first non NULL
+ // value is returned.
+ Value* value = NULL;
wtc 2011/09/01 22:42:34 Nit: move the declaration of |value| inside the fo
markusheintz_ 2011/09/02 14:55:59 Done.
+ for (ConstProviderIterator provider = content_settings_providers_.begin();
+ provider != content_settings_providers_.end();
+ ++provider) {
+ value= (*provider)->GetContentSettingValue(
Pam (message me for reviews) 2011/09/02 11:05:29 Nit: space before =
markusheintz_ 2011/09/02 14:55:59 Done.
+ primary_url, secondary_url, content_type, resource_identifier);
+ if (value)
+ return value;
+ }
+
+ // TODO(markusheintz): Add a comment.
Pam (message me for reviews) 2011/09/02 11:05:29 Please do todo.
markusheintz_ 2011/09/02 14:55:59 Done.
+ if (content_type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE)
+ return NULL;
+ return Value::CreateIntegerValue(GetDefaultContentSetting(content_type));
wtc 2011/09/01 22:42:34 It seems like you have four cases in this function
markusheintz_ 2011/09/02 14:55:59 I added some comments. I hope they answer you ques
+}
+
ContentSetting HostContentSettingsMap::GetContentSettingInternal(
const GURL& primary_url,
const GURL& secondary_url,

Powered by Google App Engine
This is Rietveld 408576698