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

Side by Side Diff: chrome/browser/prefs/pref_service_syncable.h

Issue 12033093: sync: Implementation of Priority Preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_ 5 #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_
6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_ 6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_
7 7
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/prefs/pref_model_associator.h" 9 #include "chrome/browser/prefs/pref_model_associator.h"
10 #include "components/user_prefs/pref_registry_syncable.h"
10 11
11 class PrefRegistrySyncable; 12 class PrefRegistrySyncable;
12 class PrefServiceSyncableObserver; 13 class PrefServiceSyncableObserver;
13 class Profile; 14 class Profile;
14 15
15 namespace syncer { 16 namespace syncer {
16 class SyncableService; 17 class SyncableService;
17 } 18 }
18 19
19 // A PrefService that can be synced. Users are forced to declare 20 // A PrefService that can be synced. Users are forced to declare
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Returns true if preferences state has synchronized with the remote 56 // Returns true if preferences state has synchronized with the remote
56 // preferences. If true is returned it can be assumed the local preferences 57 // preferences. If true is returned it can be assumed the local preferences
57 // has applied changes from the remote preferences. The two may not be 58 // has applied changes from the remote preferences. The two may not be
58 // identical if a change is in flight (from either side). 59 // identical if a change is in flight (from either side).
59 bool IsSyncing(); 60 bool IsSyncing();
60 61
61 void AddObserver(PrefServiceSyncableObserver* observer); 62 void AddObserver(PrefServiceSyncableObserver* observer);
62 void RemoveObserver(PrefServiceSyncableObserver* observer); 63 void RemoveObserver(PrefServiceSyncableObserver* observer);
63 64
64 // TODO(zea): Have PrefServiceSyncable implement 65 // TODO(zea): Have PrefServiceSyncable implement
65 // syncer::SyncableService directly. 66 // syncer::SyncableService directly.
Mattias Nissler (ping if slow) 2013/03/21 06:50:15 Is that TODO still relevant given that we can't im
66 syncer::SyncableService* GetSyncableService(); 67 syncer::SyncableService* GetSyncableService(const syncer::ModelType& type);
67 68
68 // Do not call this after having derived an incognito or per tab pref service. 69 // Do not call this after having derived an incognito or per tab pref service.
69 virtual void UpdateCommandLinePrefStore(PrefStore* cmd_line_store) OVERRIDE; 70 virtual void UpdateCommandLinePrefStore(PrefStore* cmd_line_store) OVERRIDE;
70 71
71 private: 72 private:
72 friend class PrefModelAssociator; 73 friend class PrefModelAssociator;
73 74
74 void AddRegisteredSyncablePreference(const char* path); 75 void AddRegisteredSyncablePreference(
76 const char* path,
77 const PrefRegistrySyncable::PrefSyncStatus sync_status);
75 78
76 // Invoked internally when the IsSyncing() state changes. 79 // Invoked internally when the IsSyncing() state changes.
77 void OnIsSyncingChanged(); 80 void OnIsSyncingChanged();
78 81
82 // Process a local preference change. This can trigger new SyncChanges being
83 // sent to the syncer.
84 void ProcessPrefChange(const std::string& name);
85
79 // Whether CreateIncognitoPrefService() has been called to create a 86 // Whether CreateIncognitoPrefService() has been called to create a
80 // "forked" PrefService. 87 // "forked" PrefService.
81 bool pref_service_forked_; 88 bool pref_service_forked_;
82 89
83 PrefModelAssociator pref_sync_associator_; 90 PrefModelAssociator pref_sync_associator_;
91 PrefModelAssociator priority_pref_sync_associator_;
84 92
85 ObserverList<PrefServiceSyncableObserver> observer_list_; 93 ObserverList<PrefServiceSyncableObserver> observer_list_;
86 94
87 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncable); 95 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncable);
88 }; 96 };
89 97
90 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_ 98 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698