Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: chrome/browser/chromeos/cros_settings_provider.h

Issue 8899002: [cros] Add --stub-cros-settings option for testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/cros_settings.cc ('k') | chrome/browser/chromeos/cros_settings_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros_settings_provider.h
diff --git a/chrome/browser/chromeos/cros_settings_provider.h b/chrome/browser/chromeos/cros_settings_provider.h
index ba65253a3f30a71a55feee707566379c61db4634..6770377998cd211ae1c12d91c62716b33072de5e 100644
--- a/chrome/browser/chromeos/cros_settings_provider.h
+++ b/chrome/browser/chromeos/cros_settings_provider.h
@@ -17,7 +17,14 @@ namespace chromeos {
class CrosSettingsProvider {
public:
- virtual ~CrosSettingsProvider() {}
+ // The callback type that is called to notify the CrosSettings observers
+ // about a setting change.
+ typedef base::Callback<void(const std::string&)> NotifyObserversCallback;
+
+ // Creates a new provider instance. |notify_cb| will be used to notify
+ // about setting changes.
+ explicit CrosSettingsProvider(const NotifyObserversCallback& notify_cb);
+ virtual ~CrosSettingsProvider();
// Sets |in_value| to given |path| in cros settings.
void Set(const std::string& path, const base::Value& in_value);
@@ -38,10 +45,17 @@ class CrosSettingsProvider {
// Reloads the caches if the provider has any.
virtual void Reload() = 0;
+ protected:
+ // Notifies the observers about a setting change.
+ void NotifyObservers(const std::string& path);
+
private:
// Does the real job for Set().
virtual void DoSet(const std::string& path,
const base::Value& in_value) = 0;
+
+ // Callback used to notify about setting changes.
+ NotifyObserversCallback notify_cb_;
};
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/cros_settings.cc ('k') | chrome/browser/chromeos/cros_settings_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698