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

Unified Diff: chrome/browser/content_settings/content_settings_extension_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_extension_provider.cc
diff --git a/chrome/browser/content_settings/content_settings_extension_provider.cc b/chrome/browser/content_settings/content_settings_extension_provider.cc
index 10c94bd3fcc7a85a426c31de8e3ae4050a3a8574..df407fa280ed632e4bd1975b742baaa26f24dd36 100644
--- a/chrome/browser/content_settings/content_settings_extension_provider.cc
+++ b/chrome/browser/content_settings/content_settings_extension_provider.cc
@@ -22,21 +22,40 @@ ExtensionProvider::~ExtensionProvider() {
}
ContentSetting ExtensionProvider::GetContentSetting(
- const GURL& embedded_url,
- const GURL& top_level_url,
+ const GURL& primary_url,
+ const GURL& secondary_url,
ContentSettingsType content_type,
const ResourceIdentifier& resource_identifier) const {
// TODO(markusheintz): Instead of getting the effective setting every time
// effective patterns could be cached in here.
DCHECK(extensions_settings_);
return extensions_settings_->GetEffectiveContentSetting(
- embedded_url,
- top_level_url,
+ primary_url,
+ secondary_url,
content_type,
resource_identifier,
incognito_);
}
+Value* ExtensionProvider::GetContentSettingValue(
+ const GURL& primary_url,
+ const GURL& secondary_url,
+ ContentSettingsType content_type,
+ const ResourceIdentifier& resource_identifier) const {
+ // TODO(markusheintz): Change the ExtensionSettingsStore to use the
+ // OriginIdentifierValueMap to allow arbitray |Value|s to be stored instead of
+ // |ContentSetting|s.
+ ContentSetting setting = GetContentSetting(
+ primary_url,
+ secondary_url,
+ content_type,
+ resource_identifier);
+ if (setting == CONTENT_SETTING_DEFAULT)
+ return NULL;
+ return Value::CreateIntegerValue(setting);
+}
+
+
void ExtensionProvider::GetAllContentSettingsRules(
ContentSettingsType content_type,
const ResourceIdentifier& resource_identifier,

Powered by Google App Engine
This is Rietveld 408576698