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

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

Issue 8539004: Replace SetContentSetting method of the content_settings::Provider interface with GetWebsiteSetting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 1 month 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_utils.cc
diff --git a/chrome/browser/content_settings/content_settings_utils.cc b/chrome/browser/content_settings/content_settings_utils.cc
index 2338507437f4729fac112dffde7bd1fb328c1df5..d038d059fced0dab29bbe2c5673c1041131c0fdd 100644
--- a/chrome/browser/content_settings/content_settings_utils.cc
+++ b/chrome/browser/content_settings/content_settings_utils.cc
@@ -121,6 +121,19 @@ bool ParseContentSettingValue(const base::Value* value,
return *setting != CONTENT_SETTING_DEFAULT;
}
+bool ValueEqualsContentSetting(const base::Value* value,
+ ContentSetting setting) {
Bernhard Bauer 2011/11/11 14:00:40 Couldn't you just implement this in terms of |Valu
markusheintz_ 2011/11/14 11:15:10 I removed this method again. Since using ValueToCo
+ if (value) {
+ DCHECK(value->GetType() == base::Value::TYPE_INTEGER);
Bernhard Bauer 2011/11/11 14:00:40 This method DCHECKS if |value| is not an integer F
markusheintz_ 2011/11/14 11:15:10 Ahhh... these last minute code changes. Anyway thi
+ int int_value;
+ bool success = value->GetAsInteger(&int_value);
+ if (success)
+ return ContentSetting(int_value == setting);
Bernhard Bauer 2011/11/11 14:00:40 Ooooooh. I'm going to pretend I didn't see this li
markusheintz_ 2011/11/14 11:15:10 No No No I did not write this :(. This was a chang
+ NOTREACHED();
+ }
+ return false;
+}
+
base::Value* GetContentSettingValueAndPatterns(
const ProviderInterface* provider,
const GURL& primary_url,

Powered by Google App Engine
This is Rietveld 408576698