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..be121196c4914375327b38552c3a2105205ad250 |
--- /dev/null |
+++ b/chrome/browser/content_settings/content_settings_supervised_provider.h |
@@ -0,0 +1,53 @@ |
+// 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 CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_ |
+#define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_ |
+ |
+// A content setting provider that is set by the custodian of a supervised user. |
+ |
+#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 base { |
+class Lock; |
Bernhard Bauer
2015/02/26 18:03:54
This class has a base::Lock member, so the fact th
knn
2015/02/27 10:43:53
Done.
Bernhard Bauer
2015/02/27 11:20:25
Include the header file here pls? (You can then re
knn
2015/02/27 12:05:14
Done.
|
+} |
+ |
+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 // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_ |