OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_SUPERVISED_PRO
VIDER_H_ |
| 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_SUPERVISED_PRO
VIDER_H_ |
| 7 |
| 8 // A content setting provider that is set by the custodian of a supervised user. |
| 9 |
| 10 #include "base/synchronization/lock.h" |
| 11 #include "components/content_settings/core/browser/content_settings_binary_value
_map.h" |
| 12 #include "components/content_settings/core/browser/content_settings_observable_p
rovider.h" |
| 13 |
| 14 class PrefService; |
| 15 |
| 16 namespace content_settings { |
| 17 |
| 18 // SupervisedProvider that provides content-settings managed by the custodian |
| 19 // of a supervised user. |
| 20 class SupervisedProvider : public ObservableProvider { |
| 21 public: |
| 22 // ProviderInterface implementations. |
| 23 RuleIterator* GetRuleIterator(ContentSettingsType content_type, |
| 24 const ResourceIdentifier& resource_identifier, |
| 25 bool incognito) const override; |
| 26 |
| 27 bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern, |
| 28 const ContentSettingsPattern& secondary_pattern, |
| 29 ContentSettingsType content_type, |
| 30 const ResourceIdentifier& resource_identifier, |
| 31 base::Value* value) override; |
| 32 |
| 33 void ClearAllContentSettingsRules(ContentSettingsType content_type) override; |
| 34 |
| 35 void ShutdownOnUIThread() override; |
| 36 |
| 37 // Callback on receiving settings from the supervised user settings service. |
| 38 void OnSupervisedSettingsAvailable(const base::DictionaryValue* settings); |
| 39 |
| 40 private: |
| 41 BinaryValueMap value_map_; |
| 42 |
| 43 // Used around accesses to the |value_map_| object to guarantee |
| 44 // thread safety. |
| 45 mutable base::Lock lock_; |
| 46 }; |
| 47 |
| 48 } // namespace content_settings |
| 49 |
| 50 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_SUPERVISED_
PROVIDER_H_ |
OLD | NEW |