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_CROS_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 namespace base { |
10 class Value; | 11 class Value; |
| 12 } |
11 | 13 |
12 namespace chromeos { | 14 namespace chromeos { |
13 | 15 |
14 class CrosSettingsProvider { | 16 class CrosSettingsProvider { |
15 public: | 17 public: |
16 virtual ~CrosSettingsProvider() {} | 18 virtual ~CrosSettingsProvider() {} |
17 | 19 |
18 // Sets |in_value| to given |path| in cros settings. | 20 // Sets |in_value| to given |path| in cros settings. |
19 // Note that this takes ownership of |in_value|. | 21 // Note that this takes ownership of |in_value|. |
20 void Set(const std::string& path, Value* in_value); | 22 void Set(const std::string& path, base::Value* in_value); |
21 | 23 |
22 // Gets settings value of given |path| to |out_value|. | 24 // Gets settings value of given |path| to |out_value|. |
23 // Note that |out_value| is owned by the caller, not this class. | 25 // Note that |out_value| is owned by the caller, not this class. |
24 virtual bool Get(const std::string& path, Value** out_value) const = 0; | 26 virtual bool Get(const std::string& path, base::Value** out_value) const = 0; |
25 | 27 |
26 // Gets the namespace prefix provided by this provider | 28 // Gets the namespace prefix provided by this provider |
27 virtual bool HandlesSetting(const std::string& path) = 0; | 29 virtual bool HandlesSetting(const std::string& path) = 0; |
28 | 30 |
29 private: | 31 private: |
30 // Does the real job for Set(). | 32 // Does the real job for Set(). |
31 virtual void DoSet(const std::string& path, Value* in_value) = 0; | 33 virtual void DoSet(const std::string& path, base::Value* in_value) = 0; |
32 }; | 34 }; |
33 | 35 |
34 } // namespace chromeos | 36 } // namespace chromeos |
35 | 37 |
36 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ | 38 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ |
OLD | NEW |