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_BASE_SYNC_PREFS_H_ |
6 #define COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ | 6 #define COMPONENTS_SYNC_BASE_SYNC_PREFS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "components/prefs/pref_member.h" | 21 #include "components/prefs/pref_member.h" |
22 #include "components/sync/base/model_type.h" | 22 #include "components/sync/base/model_type.h" |
23 #include "components/sync/core/sync_encryption_handler.h" | 23 #include "components/sync/protocol/sync.pb.h" |
24 | 24 |
25 class PrefService; | 25 class PrefService; |
26 class ProfileIOData; | 26 class ProfileIOData; |
27 | 27 |
28 namespace user_prefs { | 28 namespace user_prefs { |
29 class PrefRegistrySyncable; | 29 class PrefRegistrySyncable; |
30 } | 30 } |
31 | 31 |
32 namespace syncer { | 32 namespace syncer { |
33 | 33 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // Sync startup time (after which the LastRunVersion preference will have been | 167 // Sync startup time (after which the LastRunVersion preference will have been |
168 // updated to the current version). | 168 // updated to the current version). |
169 std::string GetLastRunVersion() const; | 169 std::string GetLastRunVersion() const; |
170 void SetLastRunVersion(const std::string& current_version); | 170 void SetLastRunVersion(const std::string& current_version); |
171 | 171 |
172 // Get/set for flag indicating that passphrase encryption transition is in | 172 // Get/set for flag indicating that passphrase encryption transition is in |
173 // progress. | 173 // progress. |
174 void SetPassphraseEncryptionTransitionInProgress(bool value); | 174 void SetPassphraseEncryptionTransitionInProgress(bool value); |
175 bool GetPassphraseEncryptionTransitionInProgress() const; | 175 bool GetPassphraseEncryptionTransitionInProgress() const; |
176 | 176 |
177 // Get/set for saved Nigori state that needs to be passed to backend | 177 // Get/set for saved Nigori specifics that must be passed to backend |
178 // initialization after transition. | 178 // initialization after transition. |
179 void SetSavedNigoriStateForPassphraseEncryptionTransition( | 179 void SetNigoriSpecificsForPassphraseTransition( |
180 const SyncEncryptionHandler::NigoriState& nigori_state); | 180 const sync_pb::NigoriSpecifics& nigori_specifics); |
181 std::unique_ptr<SyncEncryptionHandler::NigoriState> | 181 void GetNigoriSpecificsForPassphraseTransition( |
182 GetSavedNigoriStateForPassphraseEncryptionTransition() const; | 182 sync_pb::NigoriSpecifics* nigori_specifics) const; |
183 | 183 |
184 private: | 184 private: |
185 void RegisterPrefGroups(); | 185 void RegisterPrefGroups(); |
186 | 186 |
187 static void RegisterDataTypePreferredPref( | 187 static void RegisterDataTypePreferredPref( |
188 user_prefs::PrefRegistrySyncable* prefs, | 188 user_prefs::PrefRegistrySyncable* prefs, |
189 ModelType type, | 189 ModelType type, |
190 bool is_preferred); | 190 bool is_preferred); |
191 bool GetDataTypePreferred(ModelType type) const; | 191 bool GetDataTypePreferred(ModelType type) const; |
192 void SetDataTypePreferred(ModelType type, bool is_preferred); | 192 void SetDataTypePreferred(ModelType type, bool is_preferred); |
(...skipping 22 matching lines...) Expand all Loading... |
215 // pref_groups_[EXTENSIONS] = { EXTENSION_SETTINGS } | 215 // pref_groups_[EXTENSIONS] = { EXTENSION_SETTINGS } |
216 // etc. | 216 // etc. |
217 typedef std::map<ModelType, ModelTypeSet> PrefGroupsMap; | 217 typedef std::map<ModelType, ModelTypeSet> PrefGroupsMap; |
218 PrefGroupsMap pref_groups_; | 218 PrefGroupsMap pref_groups_; |
219 | 219 |
220 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); | 220 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); |
221 }; | 221 }; |
222 | 222 |
223 } // namespace syncer | 223 } // namespace syncer |
224 | 224 |
225 #endif // COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ | 225 #endif // COMPONENTS_SYNC_BASE_SYNC_PREFS_H_ |
OLD | NEW |