summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs/pref_change_registrar.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/prefs/pref_change_registrar.h')
-rw-r--r--chrome/browser/prefs/pref_change_registrar.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/prefs/pref_change_registrar.h b/chrome/browser/prefs/pref_change_registrar.h
index cd8f5eb..773c556 100644
--- a/chrome/browser/prefs/pref_change_registrar.h
+++ b/chrome/browser/prefs/pref_change_registrar.h
@@ -23,7 +23,8 @@ class PrefChangeRegistrar {
PrefChangeRegistrar();
virtual ~PrefChangeRegistrar();
- // Must be called before adding or removing observers.
+ // Must be called before adding or removing observers. Can be called more
+ // than once as long as the value of |service| doesn't change.
void Init(PrefService* service);
// Adds an pref observer for the specified pref |path| and |obs| observer
@@ -38,6 +39,12 @@ class PrefChangeRegistrar {
void Remove(const char* path,
NotificationObserver* obs);
+ // Removes all observers that have been previously added with a call to Add.
+ void RemoveAll();
+
+ // Returns true if no pref observers are registered.
+ bool IsEmpty() const;
+
private:
typedef std::pair<std::string, NotificationObserver*> ObserverRegistration;