| 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 COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_H_ | 5 #ifndef COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_H_ |
| 6 #define COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_H_ | 6 #define COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/macros.h" |
| 11 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 12 #include "components/pref_registry/pref_registry_syncable.h" | 15 #include "components/pref_registry/pref_registry_syncable.h" |
| 13 #include "components/syncable_prefs/pref_model_associator.h" | 16 #include "components/syncable_prefs/pref_model_associator.h" |
| 14 #include "components/syncable_prefs/synced_pref_observer.h" | 17 #include "components/syncable_prefs/synced_pref_observer.h" |
| 15 | 18 |
| 16 namespace syncer { | 19 namespace syncer { |
| 17 class SyncableService; | 20 class SyncableService; |
| 18 } | 21 } |
| 19 | 22 |
| 20 namespace syncable_prefs { | 23 namespace syncable_prefs { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 SyncedPrefObserver* observer); | 86 SyncedPrefObserver* observer); |
| 84 | 87 |
| 85 protected: | 88 protected: |
| 86 // Set the PrefModelAssociatorClient to use for that object during tests. | 89 // Set the PrefModelAssociatorClient to use for that object during tests. |
| 87 void SetPrefModelAssociatorClientForTesting( | 90 void SetPrefModelAssociatorClientForTesting( |
| 88 const PrefModelAssociatorClient* pref_model_associator_client); | 91 const PrefModelAssociatorClient* pref_model_associator_client); |
| 89 | 92 |
| 90 private: | 93 private: |
| 91 friend class PrefModelAssociator; | 94 friend class PrefModelAssociator; |
| 92 | 95 |
| 93 void AddRegisteredSyncablePreference(const std::string& path, uint32 flags); | 96 void AddRegisteredSyncablePreference(const std::string& path, uint32_t flags); |
| 94 | 97 |
| 95 // Invoked internally when the IsSyncing() state changes. | 98 // Invoked internally when the IsSyncing() state changes. |
| 96 void OnIsSyncingChanged(); | 99 void OnIsSyncingChanged(); |
| 97 | 100 |
| 98 // Process a local preference change. This can trigger new SyncChanges being | 101 // Process a local preference change. This can trigger new SyncChanges being |
| 99 // sent to the syncer. | 102 // sent to the syncer. |
| 100 void ProcessPrefChange(const std::string& name); | 103 void ProcessPrefChange(const std::string& name); |
| 101 | 104 |
| 102 // Whether CreateIncognitoPrefService() has been called to create a | 105 // Whether CreateIncognitoPrefService() has been called to create a |
| 103 // "forked" PrefService. | 106 // "forked" PrefService. |
| 104 bool pref_service_forked_; | 107 bool pref_service_forked_; |
| 105 | 108 |
| 106 PrefModelAssociator pref_sync_associator_; | 109 PrefModelAssociator pref_sync_associator_; |
| 107 PrefModelAssociator priority_pref_sync_associator_; | 110 PrefModelAssociator priority_pref_sync_associator_; |
| 108 | 111 |
| 109 base::ObserverList<PrefServiceSyncableObserver> observer_list_; | 112 base::ObserverList<PrefServiceSyncableObserver> observer_list_; |
| 110 | 113 |
| 111 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncable); | 114 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncable); |
| 112 }; | 115 }; |
| 113 | 116 |
| 114 } // namespace syncable_prefs | 117 } // namespace syncable_prefs |
| 115 | 118 |
| 116 #endif // COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_H_ | 119 #endif // COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_H_ |
| OLD | NEW |