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

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

Issue 902833003: Add a HostContentSettingsMap layer for Supervised Users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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_supervised_provider.h
diff --git a/components/content_settings/core/browser/content_settings_policy_provider.h b/components/content_settings/core/browser/content_settings_supervised_provider.h
similarity index 61%
copy from components/content_settings/core/browser/content_settings_policy_provider.h
copy to components/content_settings/core/browser/content_settings_supervised_provider.h
index b0a80a1a112b0254db325541acbb4e57b011e201..da9bbe608e2084c06636551a3580379ba26a62d3 100644
--- a/components/content_settings/core/browser/content_settings_policy_provider.h
+++ b/components/content_settings/core/browser/content_settings_supervised_provider.h
@@ -1,19 +1,16 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_POLICY_PROVIDER_H_
-#define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_POLICY_PROVIDER_H_
+#ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_
+#define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_
-// A content settings provider that takes its settings out of policies.
+// A content setting provider that is set by the custodian of a supervised user.
-#include <vector>
-
-#include "base/basictypes.h"
#include "base/prefs/pref_change_registrar.h"
#include "base/synchronization/lock.h"
+#include "components/content_settings/core/browser/content_settings_binary_value_map.h"
#include "components/content_settings/core/browser/content_settings_observable_provider.h"
-#include "components/content_settings/core/browser/content_settings_origin_identifier_value_map.h"
class PrefService;
@@ -23,11 +20,12 @@ class PrefRegistrySyncable;
namespace content_settings {
-// PolicyProvider that provides managed content-settings.
-class PolicyProvider : public ObservableProvider {
+// SupervisedProvider that provides content-settings managed by the custodian
+// of a supervised user.
+class SupervisedProvider : public ObservableProvider {
public:
- explicit PolicyProvider(PrefService* prefs);
- ~PolicyProvider() override;
+ explicit SupervisedProvider(PrefService* prefs);
+ ~SupervisedProvider() override;
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
// ProviderInterface implementations.
@@ -46,25 +44,16 @@ class PolicyProvider : public ObservableProvider {
void ShutdownOnUIThread() override;
private:
- // Reads the policy managed default settings.
- void ReadManagedDefaultSettings();
-
// Callback for preference changes.
void OnPreferenceChanged(const std::string& pref_name);
- // Reads the policy controlled default settings for a specific content type.
- void UpdateManagedDefaultSetting(ContentSettingsType content_type);
-
- void ReadManagedContentSettings(bool overwrite);
-
- void GetContentSettingsFromPreferences(OriginIdentifierValueMap* rules);
-
- void GetAutoSelectCertificateSettingsFromPreferences(
- OriginIdentifierValueMap* value_map);
+ // Reads the settings for a specific content type if it is set by the
+ // custodian of a supervised user.
+ void UpdateSupervisedSetting(ContentSettingsType content_type);
- void ReadManagedContentSettingsTypes(ContentSettingsType content_type);
+ void ReadContentSettingsFromPreferences();
- OriginIdentifierValueMap value_map_;
+ BinaryValueMap value_map_;
PrefService* prefs_;
@@ -74,9 +63,9 @@ class PolicyProvider : public ObservableProvider {
// thread safety.
mutable base::Lock lock_;
- DISALLOW_COPY_AND_ASSIGN(PolicyProvider);
+ DISALLOW_COPY_AND_ASSIGN(SupervisedProvider);
};
} // namespace content_settings
-#endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_POLICY_PROVIDER_H_
+#endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698