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

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

Issue 1865803002: [Policy Experimental] Add policies to allow Cookies and Pop-ups exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compiling issuese; another round of renaming; code cleanup. 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/content_settings_policy_provider.h
diff --git a/components/content_settings/core/browser/content_settings_policy_provider.h b/components/content_settings/core/browser/content_settings_policy_provider.h
index f2058456a24949fde95f63ec1d912f6c53506d9e..653e02eddbafc410687fd5f8c333f6b13bd2c5c5 100644
--- a/components/content_settings/core/browser/content_settings_policy_provider.h
+++ b/components/content_settings/core/browser/content_settings_policy_provider.h
@@ -7,6 +7,7 @@
// A content settings provider that takes its settings out of policies.
+#include <map>
#include <vector>
#include "base/macros.h"
@@ -46,14 +47,25 @@ class PolicyProvider : public ObservableProvider {
void ShutdownOnUIThread() override;
+ // Returns whether policy allows the user to set and use exceptions for
+ // |content_type|.
+ ContentSetting GetUserExceptionsUsageSettingForType(
Bernhard Bauer 2016/04/08 14:44:35 This still doesn't explain what the individual val
huangs 2016/04/11 19:01:03 Added new ContentSettingsUserExceptionsUsage. Now
+ ContentSettingsType content_type) const;
+
private:
struct PrefsForManagedDefaultMapEntry;
+ using UserExceptionsUsageSettingsMap =
+ std::map<ContentSettingsType, ContentSetting>;
+
static const PrefsForManagedDefaultMapEntry kPrefsForManagedDefault[];
// Reads the policy managed default settings.
void ReadManagedDefaultSettings();
+ // Reads the policy managed settings on user exceptions usage.
+ void ReadUserExceptionsUsageSettings();
+
// Callback for preference changes.
void OnPreferenceChanged(const std::string& pref_name);
@@ -71,6 +83,10 @@ class PolicyProvider : public ObservableProvider {
OriginIdentifierValueMap value_map_;
+ // Preference exceptions can be explictly enabled or disabled by policy for
+ // various content types. Only non-CONTENT_SETTING_DEFAULT values are stored.
+ UserExceptionsUsageSettingsMap user_exceptions_usage_settings_map_;
+
PrefService* prefs_;
PrefChangeRegistrar pref_change_registrar_;

Powered by Google App Engine
This is Rietveld 408576698