 Chromium Code Reviews
 Chromium Code Reviews Issue 12033093:
  sync: Implementation of Priority Preferences.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 12033093:
  sync: Implementation of Priority Preferences.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| 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 "chrome/browser/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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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. | 
| 66 syncer::SyncableService* GetSyncableService(); | 67 syncer::SyncableService* GetSyncableService(); | 
| 
Nicolas Zea
2013/02/25 23:47:47
perhaps merge into one call that takes a ModelType
 
albertb
2013/03/01 22:01:56
Done.
 | |
| 68 syncer::SyncableService* GetPrioritySyncableService(); | |
| 67 | 69 | 
| 68 // Do not call this after having derived an incognito or per tab pref service. | 70 // Do not call this after having derived an incognito or per tab pref service. | 
| 69 virtual void UpdateCommandLinePrefStore(PrefStore* cmd_line_store) OVERRIDE; | 71 virtual void UpdateCommandLinePrefStore(PrefStore* cmd_line_store) OVERRIDE; | 
| 70 | 72 | 
| 71 private: | 73 private: | 
| 72 friend class PrefModelAssociator; | 74 friend class PrefModelAssociator; | 
| 73 | 75 | 
| 74 void AddRegisteredSyncablePreference(const char* path); | 76 void AddRegisteredSyncablePreference(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_ | 
| OLD | NEW |