OLD | NEW |
| (Empty) |
1 // Copyright 2013 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_MANAGED_MODE_SUPERVISED_USER_PREF_STORE_H_ | |
6 #define CHROME_BROWSER_MANAGED_MODE_SUPERVISED_USER_PREF_STORE_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/observer_list.h" | |
10 #include "base/prefs/pref_store.h" | |
11 #include "chrome/browser/managed_mode/managed_users.h" | |
12 | |
13 namespace base { | |
14 class DictionaryValue; | |
15 class Value; | |
16 } | |
17 | |
18 class ManagedUserSettingsService; | |
19 class PrefValueMap; | |
20 | |
21 // A PrefStore that gets its values from managed user settings via the | |
22 // ManagedUserSettingsService passed in at construction. | |
23 class SupervisedUserPrefStore : public PrefStore { | |
24 public: | |
25 SupervisedUserPrefStore( | |
26 ManagedUserSettingsService* managed_user_settings_service); | |
27 | |
28 // PrefStore overrides: | |
29 virtual bool GetValue(const std::string& key, | |
30 const base::Value** value) const OVERRIDE; | |
31 virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; | |
32 virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; | |
33 virtual bool HasObservers() const OVERRIDE; | |
34 virtual bool IsInitializationComplete() const OVERRIDE; | |
35 | |
36 private: | |
37 virtual ~SupervisedUserPrefStore(); | |
38 | |
39 void OnNewSettingsAvailable(const base::DictionaryValue* settings); | |
40 | |
41 scoped_ptr<PrefValueMap> prefs_; | |
42 | |
43 ObserverList<PrefStore::Observer, true> observers_; | |
44 | |
45 base::WeakPtrFactory<SupervisedUserPrefStore> weak_ptr_factory_; | |
46 }; | |
47 | |
48 #endif // CHROME_BROWSER_MANAGED_MODE_SUPERVISED_USER_PREF_STORE_H_ | |
OLD | NEW |