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; |
38 void AddObserver(PrefStore::Observer* observer) override; | 39 void AddObserver(PrefStore::Observer* observer) override; |
39 void RemoveObserver(PrefStore::Observer* observer) override; | 40 void RemoveObserver(PrefStore::Observer* observer) override; |
40 bool HasObservers() const override; | 41 bool HasObservers() const override; |
41 bool IsInitializationComplete() const override; | 42 bool IsInitializationComplete() const override; |
42 | 43 |
43 // NotificationObserver implementation. | 44 // NotificationObserver implementation. |
44 void Observe(int type, | 45 void Observe(int type, |
45 const content::NotificationSource& src, | 46 const content::NotificationSource& src, |
46 const content::NotificationDetails& details) override; | 47 const content::NotificationDetails& details) override; |
47 | 48 |
48 private: | 49 private: |
49 ~SupervisedUserPrefStore() override; | 50 ~SupervisedUserPrefStore() override; |
50 | 51 |
51 void OnNewSettingsAvailable(const base::DictionaryValue* settings); | 52 void OnNewSettingsAvailable(const base::DictionaryValue* settings); |
52 | 53 |
53 std::unique_ptr< | 54 std::unique_ptr< |
54 base::CallbackList<void(const base::DictionaryValue*)>::Subscription> | 55 base::CallbackList<void(const base::DictionaryValue*)>::Subscription> |
55 user_settings_subscription_; | 56 user_settings_subscription_; |
56 content::NotificationRegistrar unsubscriber_registrar_; | 57 content::NotificationRegistrar unsubscriber_registrar_; |
57 | 58 |
58 std::unique_ptr<PrefValueMap> prefs_; | 59 std::unique_ptr<PrefValueMap> prefs_; |
59 | 60 |
60 base::ObserverList<PrefStore::Observer, true> observers_; | 61 base::ObserverList<PrefStore::Observer, true> observers_; |
61 }; | 62 }; |
62 | 63 |
63 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_ | 64 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_ |
OLD | NEW |