OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_ |
6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 // SupervisedUserSettingsService passed in at construction. | 28 // SupervisedUserSettingsService passed in at construction. |
29 class SupervisedUserPrefStore : public PrefStore, | 29 class SupervisedUserPrefStore : public PrefStore, |
30 public content::NotificationObserver { | 30 public content::NotificationObserver { |
31 public: | 31 public: |
32 SupervisedUserPrefStore( | 32 SupervisedUserPrefStore( |
33 SupervisedUserSettingsService* supervised_user_settings_service); | 33 SupervisedUserSettingsService* supervised_user_settings_service); |
34 | 34 |
35 // PrefStore overrides: | 35 // PrefStore overrides: |
36 bool GetValue(const std::string& key, | 36 bool GetValue(const std::string& key, |
37 const base::Value** value) const override; | 37 const base::Value** value) const override; |
38 std::unique_ptr<base::DictionaryValue> GetValues() const override; | |
39 void AddObserver(PrefStore::Observer* observer) override; | 38 void AddObserver(PrefStore::Observer* observer) override; |
40 void RemoveObserver(PrefStore::Observer* observer) override; | 39 void RemoveObserver(PrefStore::Observer* observer) override; |
41 bool HasObservers() const override; | 40 bool HasObservers() const override; |
42 bool IsInitializationComplete() const override; | 41 bool IsInitializationComplete() const override; |
43 | 42 |
44 // NotificationObserver implementation. | 43 // NotificationObserver implementation. |
45 void Observe(int type, | 44 void Observe(int type, |
46 const content::NotificationSource& src, | 45 const content::NotificationSource& src, |
47 const content::NotificationDetails& details) override; | 46 const content::NotificationDetails& details) override; |
48 | 47 |
49 private: | 48 private: |
50 ~SupervisedUserPrefStore() override; | 49 ~SupervisedUserPrefStore() override; |
51 | 50 |
52 void OnNewSettingsAvailable(const base::DictionaryValue* settings); | 51 void OnNewSettingsAvailable(const base::DictionaryValue* settings); |
53 | 52 |
54 std::unique_ptr< | 53 std::unique_ptr< |
55 base::CallbackList<void(const base::DictionaryValue*)>::Subscription> | 54 base::CallbackList<void(const base::DictionaryValue*)>::Subscription> |
56 user_settings_subscription_; | 55 user_settings_subscription_; |
57 content::NotificationRegistrar unsubscriber_registrar_; | 56 content::NotificationRegistrar unsubscriber_registrar_; |
58 | 57 |
59 std::unique_ptr<PrefValueMap> prefs_; | 58 std::unique_ptr<PrefValueMap> prefs_; |
60 | 59 |
61 base::ObserverList<PrefStore::Observer, true> observers_; | 60 base::ObserverList<PrefStore::Observer, true> observers_; |
62 }; | 61 }; |
63 | 62 |
64 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_ | 63 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_ |
OLD | NEW |