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 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // true and won't call the |callback|. | 38 // true and won't call the |callback|. |
39 virtual bool GetTrusted(const std::string& path, | 39 virtual bool GetTrusted(const std::string& path, |
40 const base::Closure& callback) = 0; | 40 const base::Closure& callback) = 0; |
41 | 41 |
42 // Gets the namespace prefix provided by this provider. | 42 // Gets the namespace prefix provided by this provider. |
43 virtual bool HandlesSetting(const std::string& path) const = 0; | 43 virtual bool HandlesSetting(const std::string& path) const = 0; |
44 | 44 |
45 // Reloads the caches if the provider has any. | 45 // Reloads the caches if the provider has any. |
46 virtual void Reload() = 0; | 46 virtual void Reload() = 0; |
47 | 47 |
| 48 void SetNotifyObserversCallback(const NotifyObserversCallback& notify_cb); |
| 49 |
48 protected: | 50 protected: |
49 // Notifies the observers about a setting change. | 51 // Notifies the observers about a setting change. |
50 void NotifyObservers(const std::string& path); | 52 void NotifyObservers(const std::string& path); |
51 | 53 |
52 private: | 54 private: |
53 // Does the real job for Set(). | 55 // Does the real job for Set(). |
54 virtual void DoSet(const std::string& path, | 56 virtual void DoSet(const std::string& path, |
55 const base::Value& in_value) = 0; | 57 const base::Value& in_value) = 0; |
56 | 58 |
57 // Callback used to notify about setting changes. | 59 // Callback used to notify about setting changes. |
58 NotifyObserversCallback notify_cb_; | 60 NotifyObserversCallback notify_cb_; |
59 }; | 61 }; |
60 | 62 |
61 } // namespace chromeos | 63 } // namespace chromeos |
62 | 64 |
63 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ | 65 #endif // CHROME_BROWSER_CHROMEOS_CROS_SETTINGS_PROVIDER_H_ |
OLD | NEW |