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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.h

Issue 1873343002: [Policy] HostContentSettingsMap: Add AreUserExceptionsAllowedForType() and tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DCHECK in AreUserExceptionsAllowedForType(). Created 4 years, 8 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: components/content_settings/core/browser/host_content_settings_map.h
diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h
index 17d9e126481f3c1910ff9b54f18441a9a880663b..77702e6ab618387a5af9df71ef14879eca8e6641 100644
--- a/components/content_settings/core/browser/host_content_settings_map.h
+++ b/components/content_settings/core/browser/host_content_settings_map.h
@@ -58,7 +58,7 @@ class HostContentSettingsMap : public content_settings::Observer,
CUSTOM_EXTENSION_PROVIDER,
PREF_PROVIDER,
DEFAULT_PROVIDER,
- NUM_PROVIDER_TYPES,
+ NUM_PROVIDER_TYPES
};
// This should be called on the UI thread, otherwise |thread_checker_| handles
@@ -131,6 +131,9 @@ class HostContentSettingsMap : public content_settings::Observer,
void SetDefaultContentSetting(ContentSettingsType content_type,
ContentSetting setting);
+ // Returns true if user exceptions are allowed for |content_type|.
+ bool AreUserExceptionsAllowedForType(ContentSettingsType content_type) const;
+
// Sets the content |setting| for the given patterns, |content_type| and
// |resource_identifier|. Setting the value to CONTENT_SETTING_DEFAULT causes
// the default setting for that type to be used when loading pages matching
@@ -295,6 +298,12 @@ class HostContentSettingsMap : public content_settings::Observer,
ContentSettingsType content_type,
content_settings::ProviderInterface* provider) const;
+ // Retrieves default content setting for |content_type|, and writes the
+ // provider's type to |provider_type| (must not be null).
+ ContentSetting GetDefaultContentSettingInternal(
+ ContentSettingsType content_type,
+ ProviderType* provider_type) const;
+
// Migrate old settings for ContentSettingsTypes which only use a primary
// pattern. Settings which only used a primary pattern were inconsistent in
// what they did with the secondary pattern. Some stored a
@@ -351,8 +360,6 @@ class HostContentSettingsMap : public content_settings::Observer,
ContentSettingsPattern* primary_pattern,
ContentSettingsPattern* secondary_pattern);
- content_settings::PrefProvider* GetPrefProvider();
-
#ifndef NDEBUG
// This starts as the thread ID of the thread that constructs this
// object, and remains until used by a different thread, at which
@@ -374,6 +381,9 @@ class HostContentSettingsMap : public content_settings::Observer,
// before any other uses of it.
ProviderMap content_settings_providers_;
+ // content_settings_providers_[PREF_PROVIDER] but specialized.
+ content_settings::PrefProvider* pref_provider_ = nullptr;
+
base::ThreadChecker thread_checker_;
base::ObserverList<content_settings::Observer> observers_;

Powered by Google App Engine
This is Rietveld 408576698