summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs/pref_service_syncable.h
diff options
context:
space:
mode:
authoralbertb@chromium.org <albertb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 22:18:55 +0000
committeralbertb@chromium.org <albertb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 22:18:55 +0000
commit43fe640e64aac277a5e0b28fe6b58d2973164df8 (patch)
tree367962ca89c283d63bb3ef810e6593f3b0317811 /chrome/browser/prefs/pref_service_syncable.h
parentcbe30167853f161d2aaa16846d9b8bea16027858 (diff)
downloadchromium_src-43fe640e64aac277a5e0b28fe6b58d2973164df8.zip
chromium_src-43fe640e64aac277a5e0b28fe6b58d2973164df8.tar.gz
chromium_src-43fe640e64aac277a5e0b28fe6b58d2973164df8.tar.bz2
sync: Implementation of Priority Preferences.
Priority preferences are similar to normal preferences but are never encrypted and are synced ahead of other datatypes. Because they're never encrypted, on first sync, they can be synced immediately after login, before the user is prompted for a passphrase. Expected uses of priority preferences include hardware setting (eg. trackpad speed, scroll direction, etc.) as well as settings that could be 2-way synced with existing Google Account settings (eg. language). BUG=168648 Review URL: https://chromiumcodereview.appspot.com/12033093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191047 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prefs/pref_service_syncable.h')
-rw-r--r--chrome/browser/prefs/pref_service_syncable.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/prefs/pref_service_syncable.h b/chrome/browser/prefs/pref_service_syncable.h
index 18926b6..971a922 100644
--- a/chrome/browser/prefs/pref_service_syncable.h
+++ b/chrome/browser/prefs/pref_service_syncable.h
@@ -7,6 +7,7 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/prefs/pref_model_associator.h"
+#include "components/user_prefs/pref_registry_syncable.h"
class PrefRegistrySyncable;
class PrefServiceSyncableObserver;
@@ -56,14 +57,22 @@ class PrefServiceSyncable : public PrefService {
// 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).
+ //
+ // TODO(albertb): Given that we now support priority preferences, callers of
+ // this method are likely better off making the preferences they care about
+ // into priority preferences and calling IsPrioritySyncing().
bool IsSyncing();
+ // Returns true if priority preferences state has synchronized with the remote
+ // priority preferences.
+ bool IsPrioritySyncing();
+
void AddObserver(PrefServiceSyncableObserver* observer);
void RemoveObserver(PrefServiceSyncableObserver* observer);
// TODO(zea): Have PrefServiceSyncable implement
// syncer::SyncableService directly.
- syncer::SyncableService* GetSyncableService();
+ syncer::SyncableService* GetSyncableService(const syncer::ModelType& type);
// Do not call this after having derived an incognito or per tab pref service.
virtual void UpdateCommandLinePrefStore(PrefStore* cmd_line_store) OVERRIDE;
@@ -71,16 +80,23 @@ class PrefServiceSyncable : public PrefService {
private:
friend class PrefModelAssociator;
- void AddRegisteredSyncablePreference(const char* path);
+ void AddRegisteredSyncablePreference(
+ const char* path,
+ const PrefRegistrySyncable::PrefSyncStatus sync_status);
// Invoked internally when the IsSyncing() state changes.
void OnIsSyncingChanged();
+ // Process a local preference change. This can trigger new SyncChanges being
+ // sent to the syncer.
+ void ProcessPrefChange(const std::string& name);
+
// Whether CreateIncognitoPrefService() has been called to create a
// "forked" PrefService.
bool pref_service_forked_;
PrefModelAssociator pref_sync_associator_;
+ PrefModelAssociator priority_pref_sync_associator_;
ObserverList<PrefServiceSyncableObserver> observer_list_;