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

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, 10 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 "components/content_settings/core/browser/content_settings_binary_value _map.h"
11 #include "components/content_settings/core/browser/content_settings_observable_p rovider.h"
12
13 class PrefService;
14 class SupervisedUserSettingsService;
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 SupervisedProvider(
Bernhard Bauer 2015/02/27 11:20:25 Single-argument constructors should be marked expl
knn 2015/02/27 12:05:15 Done.
23 SupervisedUserSettingsService* supervised_user_settings_service);
24
25 // ProviderInterface implementations.
26 RuleIterator* GetRuleIterator(ContentSettingsType content_type,
27 const ResourceIdentifier& resource_identifier,
28 bool incognito) const override;
29
30 bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern,
31 const ContentSettingsPattern& secondary_pattern,
32 ContentSettingsType content_type,
33 const ResourceIdentifier& resource_identifier,
34 base::Value* value) override;
35
36 void ClearAllContentSettingsRules(ContentSettingsType content_type) override;
37
38 void ShutdownOnUIThread() override;
39
40 // Callback on receiving settings from the supervised user settings service.
41 void OnSupervisedSettingsAvailable(const base::DictionaryValue* settings);
42
43 private:
44 BinaryValueMap value_map_;
45
46 // Used around accesses to the |value_map_| object to guarantee
47 // thread safety.
48 mutable base::Lock lock_;
49
50 base::WeakPtrFactory<SupervisedProvider> weak_ptr_factory_;
Bernhard Bauer 2015/02/27 11:20:25 Add DISALLOW_COPY_AND_ASSIGN? I'm not sure I want
knn 2015/02/27 12:05:15 Done.
51 };
52
53 } // namespace content_settings
54
55 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_SUPERVISED_PROVIDER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698