| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 class Value; | 10 class Value; |
| 11 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 | 13 |
| 14 class CrosSettingsProvider { | 14 class CrosSettingsProvider { |
| 15 public: | 15 public: |
| 16 virtual ~CrosSettingsProvider() {} | 16 virtual ~CrosSettingsProvider() {} |
| 17 | 17 |
| 18 // Sets |in_value| to given |path| in cros settings. | 18 // Sets |in_value| to given |path| in cros settings. |
| 19 // Note that this takes ownership of |in_value|. | 19 // Note that this takes ownership of |in_value|. |
| 20 virtual void Set(const std::string& path, Value* in_value) = 0; | 20 virtual void Set(const std::string& path, Value* in_value) = 0; |
| 21 | 21 |
| 22 // Gets settings value of given |path| to |out_value|. | 22 // Gets settings value of given |path| to |out_value|. |
| 23 // Note that |out_value| is still owned by this class. | 23 // Note that |out_value| is still owned by this class. |
| 24 virtual bool Get(const std::string& path, Value** out_value) const = 0; | 24 virtual bool Get(const std::string& path, Value** out_value) const = 0; |
| 25 | 25 |
| 26 // Gets the namespace prefix provided by this provider | 26 // Gets the namespace prefix provided by this provider |
| 27 virtual bool HandlesSetting(const std::string& path) = 0; | 27 virtual bool HandlesSetting(const std::string& path) = 0; |
| 28 |
| 29 protected: |
| 30 // Fires system setting change notification. |
| 31 void FireObservers(const char* path); |
| 32 |
| 28 }; | 33 }; |
| 29 | 34 |
| 30 } // namespace chromeos | 35 } // namespace chromeos |
| 31 | 36 |
| 32 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ | 37 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ |
| OLD | NEW |