| 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_SYNC_DRIVER_SYNC_PREFS_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // Maps |data_type| to its corresponding preference name. | 116 // Maps |data_type| to its corresponding preference name. |
| 117 static const char* GetPrefNameForDataType(syncer::ModelType data_type); | 117 static const char* GetPrefNameForDataType(syncer::ModelType data_type); |
| 118 | 118 |
| 119 #if defined(OS_CHROMEOS) | 119 #if defined(OS_CHROMEOS) |
| 120 // Use this spare bootstrap token only when setting up sync for the first | 120 // Use this spare bootstrap token only when setting up sync for the first |
| 121 // time. | 121 // time. |
| 122 std::string GetSpareBootstrapToken() const; | 122 std::string GetSpareBootstrapToken() const; |
| 123 void SetSpareBootstrapToken(const std::string& token); | 123 void SetSpareBootstrapToken(const std::string& token); |
| 124 #endif | 124 #endif |
| 125 | 125 |
| 126 // Merges the given set of types with the set of acknowledged types. | |
| 127 void AcknowledgeSyncedTypes(syncer::ModelTypeSet types); | |
| 128 | |
| 129 // Get/Set number of rollback attempts allowed. | 126 // Get/Set number of rollback attempts allowed. |
| 130 virtual int GetRemainingRollbackTries() const; | 127 virtual int GetRemainingRollbackTries() const; |
| 131 virtual void SetRemainingRollbackTries(int times); | 128 virtual void SetRemainingRollbackTries(int times); |
| 132 | 129 |
| 133 // Get/set/clear first sync time of current user. Used to roll back browsing | 130 // Get/set/clear first sync time of current user. Used to roll back browsing |
| 134 // data later when user signs out. | 131 // data later when user signs out. |
| 135 base::Time GetFirstSyncTime() const; | 132 base::Time GetFirstSyncTime() const; |
| 136 void SetFirstSyncTime(base::Time time); | 133 void SetFirstSyncTime(base::Time time); |
| 137 void ClearFirstSyncTime(); | 134 void ClearFirstSyncTime(); |
| 138 | 135 |
| 139 // For testing. | 136 // For testing. |
| 140 | 137 |
| 141 void SetManagedForTest(bool is_managed); | 138 void SetManagedForTest(bool is_managed); |
| 142 syncer::ModelTypeSet GetAcknowledgeSyncedTypesForTest() const; | |
| 143 | 139 |
| 144 private: | 140 private: |
| 145 void RegisterPrefGroups(); | 141 void RegisterPrefGroups(); |
| 146 | 142 |
| 147 static void RegisterDataTypePreferredPref( | 143 static void RegisterDataTypePreferredPref( |
| 148 user_prefs::PrefRegistrySyncable* prefs, | 144 user_prefs::PrefRegistrySyncable* prefs, |
| 149 syncer::ModelType type, | 145 syncer::ModelType type, |
| 150 bool is_preferred); | 146 bool is_preferred); |
| 151 bool GetDataTypePreferred(syncer::ModelType type) const; | 147 bool GetDataTypePreferred(syncer::ModelType type) const; |
| 152 void SetDataTypePreferred(syncer::ModelType type, bool is_preferred); | 148 void SetDataTypePreferred(syncer::ModelType type, bool is_preferred); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 176 // etc. | 172 // etc. |
| 177 typedef std::map<syncer::ModelType, syncer::ModelTypeSet> PrefGroupsMap; | 173 typedef std::map<syncer::ModelType, syncer::ModelTypeSet> PrefGroupsMap; |
| 178 PrefGroupsMap pref_groups_; | 174 PrefGroupsMap pref_groups_; |
| 179 | 175 |
| 180 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); | 176 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); |
| 181 }; | 177 }; |
| 182 | 178 |
| 183 } // namespace sync_driver | 179 } // namespace sync_driver |
| 184 | 180 |
| 185 #endif // COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ | 181 #endif // COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ |
| OLD | NEW |