Index: chrome/browser/content_settings/content_settings_supervised_provider.h |
diff --git a/chrome/browser/content_settings/content_settings_supervised_provider.h b/chrome/browser/content_settings/content_settings_supervised_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..76f1bec738ad448d389b06365140a6361a1c9759 |
--- /dev/null |
+++ b/chrome/browser/content_settings/content_settings_supervised_provider.h |
@@ -0,0 +1,50 @@ |
+// 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_SUPERVISED_PROVIDER_H_ |
+#define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_ |
+ |
+// A content setting provider that is set by the custodian of a supervised user. |
+ |
+#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" |
+ |
+class PrefService; |
+ |
+namespace content_settings { |
+ |
+// SupervisedProvider that provides content-settings managed by the custodian |
+// of a supervised user. |
+class SupervisedProvider : public ObservableProvider { |
+ public: |
+ // ProviderInterface implementations. |
+ RuleIterator* GetRuleIterator(ContentSettingsType content_type, |
+ const ResourceIdentifier& resource_identifier, |
+ bool incognito) const override; |
+ |
+ bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern, |
+ const ContentSettingsPattern& secondary_pattern, |
+ ContentSettingsType content_type, |
+ const ResourceIdentifier& resource_identifier, |
+ base::Value* value) override; |
+ |
+ void ClearAllContentSettingsRules(ContentSettingsType content_type) override; |
+ |
+ void ShutdownOnUIThread() override; |
+ |
+ // Callback on receiving settings from the supervised user settings service. |
+ void OnSupervisedSettingsAvailable(const base::DictionaryValue* settings); |
+ |
+ private: |
+ BinaryValueMap value_map_; |
+ |
+ // Used around accesses to the |value_map_| object to guarantee |
+ // thread safety. |
+ mutable base::Lock lock_; |
+}; |
+ |
+} // namespace content_settings |
+ |
+#endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_ |