Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / supervised_user / supervised_user_pref_store.h
blobc8a4e8128c4aa79f49a3270932e6c47ab3780e5f
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 <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/observer_list.h"
12 #include "base/prefs/pref_store.h"
13 #include "chrome/browser/supervised_user/supervised_users.h"
15 namespace base {
16 class DictionaryValue;
17 class Value;
20 class PrefValueMap;
21 class SupervisedUserSettingsService;
23 // A PrefStore that gets its values from supervised user settings via the
24 // SupervisedUserSettingsService passed in at construction.
25 class SupervisedUserPrefStore : public PrefStore {
26 public:
27 SupervisedUserPrefStore(
28 SupervisedUserSettingsService* supervised_user_settings_service);
30 // PrefStore overrides:
31 bool GetValue(const std::string& key,
32 const base::Value** value) const override;
33 void AddObserver(PrefStore::Observer* observer) override;
34 void RemoveObserver(PrefStore::Observer* observer) override;
35 bool HasObservers() const override;
36 bool IsInitializationComplete() const override;
38 private:
39 ~SupervisedUserPrefStore() override;
41 void OnNewSettingsAvailable(const base::DictionaryValue* settings);
43 scoped_ptr<PrefValueMap> prefs_;
45 ObserverList<PrefStore::Observer, true> observers_;
47 base::WeakPtrFactory<SupervisedUserPrefStore> weak_ptr_factory_;
50 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_PREF_STORE_H_