Index: chrome/browser/prefs/pref_service.h |
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h |
index a083cc92ed9f7a38b91b7d86f5a8dd099aa5ab92..6f4fba29b2cd412504fb2e2584faf018c5a553c6 100644 |
--- a/chrome/browser/prefs/pref_service.h |
+++ b/chrome/browser/prefs/pref_service.h |
@@ -16,6 +16,7 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/observer_list.h" |
#include "base/threading/non_thread_safe.h" |
#include "chrome/browser/api/prefs/pref_service_base.h" |
@@ -25,6 +26,7 @@ class PersistentPrefStore; |
class PrefModelAssociator; |
class PrefNotifier; |
class PrefNotifierImpl; |
+class PrefServiceObserver; |
class PrefStore; |
class PrefValueStore; |
@@ -128,6 +130,18 @@ class PrefService : public PrefServiceBase, public base::NonThreadSafe { |
// immediately (basically, during shutdown). |
void CommitPendingWrite(); |
+ void AddObserver(PrefServiceObserver* observer); |
+ void RemoveObserver(PrefServiceObserver* observer); |
+ |
+ // Returns true if preferences state has synchronized with the remote |
+ // preferences. If true is returned it can be assumed the local preferences |
+ // has applied changes from the remote preferences. The two may not be |
+ // identical if a change is in flight (from either side). |
+ bool HasSynced(); |
sky
2012/10/23 00:24:21
I'm not the biggest fan of this name. If you have
|
+ |
+ // Invoked internally when the HasSynced() state changes. |
+ void HasSyncedChanged(); |
+ |
// PrefServiceBase implementation. |
virtual bool IsManagedPreference(const char* pref_name) const OVERRIDE; |
virtual bool IsUserModifiablePreference(const char* pref_name) const OVERRIDE; |
@@ -343,6 +357,8 @@ class PrefService : public PrefServiceBase, public base::NonThreadSafe { |
// "forked" PrefService. |
bool pref_service_forked_; |
+ ObserverList<PrefServiceObserver> observer_list_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PrefService); |
}; |