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

Unified Diff: chrome/browser/content_settings/content_settings_mock_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: Comments addressed. 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_mock_provider.cc
diff --git a/chrome/browser/content_settings/content_settings_mock_provider.cc b/chrome/browser/content_settings/content_settings_mock_provider.cc
index 78751d8e34bc863fdc906e35e07e81666e5a5db0..c0a231baad551dbca9e1b8fcb3bb56b22bf165ee 100644
--- a/chrome/browser/content_settings/content_settings_mock_provider.cc
+++ b/chrome/browser/content_settings/content_settings_mock_provider.cc
@@ -65,11 +65,11 @@ MockProvider::MockProvider(ContentSettingsPattern requesting_url_pattern,
MockProvider::~MockProvider() {}
ContentSetting MockProvider::GetContentSetting(
- const GURL& requesting_url,
- const GURL& embedding_url,
+ const GURL& primary_url,
+ const GURL& secondary_url,
ContentSettingsType content_type,
const ResourceIdentifier& resource_identifier) const {
- if (requesting_url_pattern_.Matches(requesting_url) &&
+ if (requesting_url_pattern_.Matches(primary_url) &&
content_type_ == content_type &&
resource_identifier_ == resource_identifier) {
return setting_;
@@ -77,6 +77,21 @@ ContentSetting MockProvider::GetContentSetting(
return CONTENT_SETTING_DEFAULT;
}
+Value* MockProvider::GetContentSettingValue(
+ const GURL& primary_url,
+ const GURL& secondary_url,
+ ContentSettingsType content_type,
+ const ResourceIdentifier& resource_identifier) const {
+ ContentSetting setting = GetContentSetting(
+ primary_url,
+ secondary_url,
+ content_type,
+ resource_identifier);
+ if (setting == CONTENT_SETTING_DEFAULT)
+ return NULL;
+ return Value::CreateIntegerValue(setting);
+}
+
void MockProvider::SetContentSetting(
const ContentSettingsPattern& requesting_url_pattern,
const ContentSettingsPattern& embedding_url_pattern,

Powered by Google App Engine
This is Rietveld 408576698