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

Unified Diff: chrome/browser/prefs/pref_change_registrar.h

Issue 3304015: Use PrefChangeRegistrar everywhere (Closed)
Patch Set: final version for commit Created 10 years, 3 months 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
Index: chrome/browser/prefs/pref_change_registrar.h
diff --git a/chrome/browser/prefs/pref_change_registrar.h b/chrome/browser/prefs/pref_change_registrar.h
index cd8f5ebb8db5fc1da33fe92efdb7dbddd1a8750c..773c55614b2c72983be99c75eceb0b87cfd9309c 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;
« no previous file with comments | « chrome/browser/notifications/desktop_notification_service.cc ('k') | chrome/browser/prefs/pref_change_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698