OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROMEOS_STUB_CROS_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STUB_CROS_SETTINGS_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STUB_CROS_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STUB_CROS_SETTINGS_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/browser/chromeos/cros_settings_provider.h" | 11 #include "chrome/browser/chromeos/cros_settings_provider.h" |
12 #include "chrome/browser/prefs/pref_value_map.h" | 12 #include "chrome/browser/prefs/pref_value_map.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 | 15 |
16 class CrosSettings; | 16 class CrosSettings; |
17 | 17 |
18 // CrosSettingsProvider implementation that stores settings in memory unsigned. | 18 // CrosSettingsProvider implementation that stores settings in memory unsigned. |
19 class StubCrosSettingsProvider : public CrosSettingsProvider { | 19 class StubCrosSettingsProvider : public CrosSettingsProvider { |
20 public: | 20 public: |
21 explicit StubCrosSettingsProvider(const NotifyObserversCallback& notify_cb); | 21 explicit StubCrosSettingsProvider(const NotifyObserversCallback& notify_cb); |
| 22 StubCrosSettingsProvider(); |
22 virtual ~StubCrosSettingsProvider(); | 23 virtual ~StubCrosSettingsProvider(); |
23 | 24 |
24 // CrosSettingsProvider implementation. | 25 // CrosSettingsProvider implementation. |
25 virtual const base::Value* Get(const std::string& path) const OVERRIDE; | 26 virtual const base::Value* Get(const std::string& path) const OVERRIDE; |
26 virtual bool GetTrusted(const std::string& path, | 27 virtual bool GetTrusted(const std::string& path, |
27 const base::Closure& callback) OVERRIDE; | 28 const base::Closure& callback) OVERRIDE; |
28 virtual bool HandlesSetting(const std::string& path) const OVERRIDE; | 29 virtual bool HandlesSetting(const std::string& path) const OVERRIDE; |
29 virtual void Reload() OVERRIDE; | 30 virtual void Reload() OVERRIDE; |
30 | 31 |
31 private: | 32 private: |
32 // CrosSettingsProvider implementation: | 33 // CrosSettingsProvider implementation: |
33 virtual void DoSet(const std::string& path, | 34 virtual void DoSet(const std::string& path, |
34 const base::Value& value) OVERRIDE; | 35 const base::Value& value) OVERRIDE; |
35 | 36 |
36 // Initializes settings to their defaults. | 37 // Initializes settings to their defaults. |
37 void SetDefaults(); | 38 void SetDefaults(); |
38 | 39 |
39 // In-memory settings storage. | 40 // In-memory settings storage. |
40 PrefValueMap values_; | 41 PrefValueMap values_; |
41 | 42 |
42 CrosSettings* cros_settings_; | 43 CrosSettings* cros_settings_; |
43 | 44 |
44 DISALLOW_COPY_AND_ASSIGN(StubCrosSettingsProvider); | 45 DISALLOW_COPY_AND_ASSIGN(StubCrosSettingsProvider); |
45 }; | 46 }; |
46 | 47 |
47 } // namespace chromeos | 48 } // namespace chromeos |
48 | 49 |
49 #endif // CHROME_BROWSER_CHROMEOS_STUB_CROS_SETTINGS_PROVIDER_H_ | 50 #endif // CHROME_BROWSER_CHROMEOS_STUB_CROS_SETTINGS_PROVIDER_H_ |
OLD | NEW |