Chromium Code Reviews| Index: chrome/browser/prefs/pref_service_syncable.h |
| diff --git a/chrome/browser/prefs/pref_service_syncable.h b/chrome/browser/prefs/pref_service_syncable.h |
| index da52017911454d014c83796fee049b9e098056fa..8f8bbf0e5adfec6ffc2f439ab99706ae5394dd7f 100644 |
| --- a/chrome/browser/prefs/pref_service_syncable.h |
| +++ b/chrome/browser/prefs/pref_service_syncable.h |
| @@ -5,13 +5,15 @@ |
| #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_ |
| #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_ |
| +#include "base/callback_forward.h" |
| #include "base/prefs/pref_service.h" |
| #include "chrome/browser/prefs/pref_model_associator.h" |
| #include "chrome/browser/prefs/synced_pref_observer.h" |
| #include "components/pref_registry/pref_registry_syncable.h" |
| +class OverlayUserPrefStore; |
| +class PrefModelAssociatorClient; |
| class PrefServiceSyncableObserver; |
| -class Profile; |
| namespace syncer { |
| class SyncableService; |
| @@ -22,36 +24,31 @@ class SyncableService; |
| // this PrefService. |
| class PrefServiceSyncable : public PrefService { |
| public: |
| - // PrefServiceSyncable is a PrefService with added integration for |
| - // sync, and knowledge of how to create an incognito |
| - // PrefService. For code that does not need to know about the sync |
| - // integration, you should use only the plain PrefService type. |
| - // |
| - // For this reason, Profile does not expose an accessor for the |
| - // PrefServiceSyncable type. Instead, you can use the utilities |
| - // below to retrieve the PrefServiceSyncable (or its incognito |
| - // version) from a Profile. |
| - static PrefServiceSyncable* FromProfile(Profile* profile); |
| - static PrefServiceSyncable* IncognitoFromProfile(Profile* profile); |
| - |
| // You may wish to use PrefServiceFactory or one of its subclasses |
| // for simplified construction. |
| - PrefServiceSyncable( |
| - PrefNotifierImpl* pref_notifier, |
| - PrefValueStore* pref_value_store, |
| - PersistentPrefStore* user_prefs, |
| - user_prefs::PrefRegistrySyncable* pref_registry, |
| - base::Callback<void(PersistentPrefStore::PrefReadError)> |
| - read_error_callback, |
| - bool async); |
| + PrefServiceSyncable(PrefNotifierImpl* pref_notifier, |
| + PrefValueStore* pref_value_store, |
| + PersistentPrefStore* user_prefs, |
| + user_prefs::PrefRegistrySyncable* pref_registry, |
| + base::Callback<void(PersistentPrefStore::PrefReadError)> |
| + read_error_callback, |
| + bool async); |
| ~PrefServiceSyncable() override; |
| + // Sets the PrefModelAssociatorClient that control special treatment of |
| + // some preferences during synchronisation. Must be called before starting |
| + // the synchronisation. |
| + void SetPrefModelAssociatorClient( |
| + PrefModelAssociatorClient* pref_model_associator_client); |
|
gab
2015/09/10 14:15:09
Feels this should be a constructor input (since it
|
| + |
| // Creates an incognito copy of the pref service that shares most pref stores |
| // but uses a fresh non-persistent overlay for the user pref store and an |
| // individual extension pref store (to cache the effective extension prefs for |
| // incognito windows). |
|
gab
2015/09/10 14:15:09
Update comment.
|
| PrefServiceSyncable* CreateIncognitoPrefService( |
| - PrefStore* incognito_extension_prefs); |
| + PrefStore* incognito_extension_prefs, |
| + const base::Callback<void(OverlayUserPrefStore*)>& |
| + incognito_pref_created_cb); |
| // Returns true if preferences state has synchronized with the remote |
| // preferences. If true is returned it can be assumed the local preferences |
| @@ -104,6 +101,7 @@ class PrefServiceSyncable : public PrefService { |
| PrefModelAssociator pref_sync_associator_; |
| PrefModelAssociator priority_pref_sync_associator_; |
| + PrefModelAssociatorClient* pref_model_associator_client_; |
| base::ObserverList<PrefServiceSyncableObserver> observer_list_; |