Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM
[chromium-blink-merge.git] / chrome / browser / supervised_user / supervised_user_pref_store.h
blob98df2c206f52a1176b1b19e7ad058f6719190585
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_
6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/observer_list.h"
10 #include "base/prefs/pref_store.h"
11 #include "chrome/browser/supervised_user/supervised_users.h"
13 namespace base {
14 class DictionaryValue;
15 class Value;
18 class PrefValueMap;
19 class SupervisedUserSettingsService;
21 // A PrefStore that gets its values from supervised user settings via the
22 // SupervisedUserSettingsService passed in at construction.
23 class SupervisedUserPrefStore : public PrefStore {
24 public:
25 SupervisedUserPrefStore(
26 SupervisedUserSettingsService* supervised_user_settings_service);
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;
36 private:
37 virtual ~SupervisedUserPrefStore();
39 void OnNewSettingsAvailable(const base::DictionaryValue* settings);
41 scoped_ptr<PrefValueMap> prefs_;
43 ObserverList<PrefStore::Observer, true> observers_;
45 base::WeakPtrFactory<SupervisedUserPrefStore> weak_ptr_factory_;
48 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_