Vectorize sad tab image.
[chromium-blink-merge.git] / chrome / browser / content_settings / content_settings_supervised_provider.h
blobef305a57ee1f045749a33e06423e7c228ed8894a
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.
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_
8 // A content setting provider that is set by the custodian of a supervised user.
10 #include "base/callback_list.h"
11 #include "base/synchronization/lock.h"
12 #include "components/content_settings/core/browser/content_settings_binary_value_map.h"
13 #include "components/content_settings/core/browser/content_settings_observable_provider.h"
15 class PrefService;
16 class SupervisedUserSettingsService;
18 namespace content_settings {
20 // SupervisedProvider that provides content-settings managed by the custodian
21 // of a supervised user.
22 class SupervisedProvider : public ObservableProvider {
23 public:
24 explicit SupervisedProvider(
25 SupervisedUserSettingsService* supervised_user_settings_service);
26 ~SupervisedProvider() override;
28 // ProviderInterface implementations.
29 RuleIterator* GetRuleIterator(ContentSettingsType content_type,
30 const ResourceIdentifier& resource_identifier,
31 bool incognito) const override;
33 bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern,
34 const ContentSettingsPattern& secondary_pattern,
35 ContentSettingsType content_type,
36 const ResourceIdentifier& resource_identifier,
37 base::Value* value) override;
39 void ClearAllContentSettingsRules(ContentSettingsType content_type) override;
41 void ShutdownOnUIThread() override;
43 // Callback on receiving settings from the supervised user settings service.
44 void OnSupervisedSettingsAvailable(const base::DictionaryValue* settings);
46 private:
47 BinaryValueMap value_map_;
49 // Used around accesses to the |value_map_| object to guarantee
50 // thread safety.
51 mutable base::Lock lock_;
53 scoped_ptr<base::CallbackList<void(
54 const base::DictionaryValue*)>::Subscription> user_settings_subscription_;
56 DISALLOW_COPY_AND_ASSIGN(SupervisedProvider);
59 } // namespace content_settings
61 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_