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

Side by Side Diff: chrome/browser/content_settings/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: Addressed Comments Created 5 years, 9 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 unified diff | Download patch
OLDNEW
(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 CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_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 class SupervisedUserSettingsService;
16
17 namespace content_settings {
18
19 // SupervisedProvider that provides content-settings managed by the custodian
20 // of a supervised user.
21 class SupervisedProvider : public ObservableProvider {
22 public:
23 explict SupervisedProvider(
24 SupervisedUserSettingsService* supervised_user_settings_service);
25
26 // ProviderInterface implementations.
27 RuleIterator* GetRuleIterator(ContentSettingsType content_type,
28 const ResourceIdentifier& resource_identifier,
29 bool incognito) const override;
30
31 bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern,
32 const ContentSettingsPattern& secondary_pattern,
33 ContentSettingsType content_type,
34 const ResourceIdentifier& resource_identifier,
35 base::Value* value) override;
36
37 void ClearAllContentSettingsRules(ContentSettingsType content_type) override;
38
39 void ShutdownOnUIThread() override;
40
41 // Callback on receiving settings from the supervised user settings service.
42 void OnSupervisedSettingsAvailable(const base::DictionaryValue* settings);
43
44 private:
45 BinaryValueMap value_map_;
46
47 // Used around accesses to the |value_map_| object to guarantee
48 // thread safety.
49 mutable base::Lock lock_;
50
51 base::WeakPtrFactory<SupervisedProvider> weak_ptr_factory_;
52
53 DISALLOW_COPY_AND_ASSIGN(SupervisedProvider);
54 };
55
56 } // namespace content_settings
57
58 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698