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

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

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 2 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_service.h
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h
index 82b91676bc53aee3d8127dca81f5b762a89bb77f..ff4585ccd2d63d4bcf0285476d7f1edb5c6837b1 100644
--- a/chrome/browser/prefs/pref_service.h
+++ b/chrome/browser/prefs/pref_service.h
@@ -14,6 +14,7 @@
#include <set>
#include <string>
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/hash_tables.h"
@@ -27,6 +28,7 @@ class PersistentPrefStore;
class PrefModelAssociator;
class PrefNotifier;
class PrefNotifierImpl;
+class PrefObserver;
class PrefServiceObserver;
class PrefStore;
class PrefValueStore;
@@ -271,6 +273,11 @@ class PrefService : public PrefServiceBase, public base::NonThreadSafe {
// Do not call this after having derived an incognito or per tab pref service.
void UpdateCommandLinePrefStore(CommandLine* command_line);
+ // We run the callback once, when initialization completes. The bool
+ // parameter will be set to true for successful initialization,
+ // false for unsuccessful.
+ void AddPrefInitObserver(base::Callback<void(bool)> callback);
+
protected:
// Construct a new pref service. This constructor is what
// factory methods end up calling and what is used for unit tests.
@@ -300,9 +307,9 @@ class PrefService : public PrefServiceBase, public base::NonThreadSafe {
// PrefServiceBase implementation (protected in base, private here).
virtual void AddPrefObserver(const char* path,
- content::NotificationObserver* obs) OVERRIDE;
+ PrefObserver* obs) OVERRIDE;
virtual void RemovePrefObserver(const char* path,
- content::NotificationObserver* obs) OVERRIDE;
+ PrefObserver* obs) OVERRIDE;
// Sends notification of a changed preference. This needs to be called by
// a ScopedUserPrefUpdate if a DictionaryValue or ListValue is changed.

Powered by Google App Engine
This is Rietveld 408576698