OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "sync/syncable/nigori_util.h" | 5 #include "sync/syncable/nigori_util.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 nigori->set_encrypt_extensions( | 268 nigori->set_encrypt_extensions( |
269 encrypted_types.Has(EXTENSIONS)); | 269 encrypted_types.Has(EXTENSIONS)); |
270 nigori->set_encrypt_search_engines( | 270 nigori->set_encrypt_search_engines( |
271 encrypted_types.Has(SEARCH_ENGINES)); | 271 encrypted_types.Has(SEARCH_ENGINES)); |
272 nigori->set_encrypt_sessions(encrypted_types.Has(SESSIONS)); | 272 nigori->set_encrypt_sessions(encrypted_types.Has(SESSIONS)); |
273 nigori->set_encrypt_app_settings( | 273 nigori->set_encrypt_app_settings( |
274 encrypted_types.Has(APP_SETTINGS)); | 274 encrypted_types.Has(APP_SETTINGS)); |
275 nigori->set_encrypt_apps(encrypted_types.Has(APPS)); | 275 nigori->set_encrypt_apps(encrypted_types.Has(APPS)); |
276 nigori->set_encrypt_app_notifications( | 276 nigori->set_encrypt_app_notifications( |
277 encrypted_types.Has(APP_NOTIFICATIONS)); | 277 encrypted_types.Has(APP_NOTIFICATIONS)); |
| 278 nigori->set_encrypt_dictionary(encrypted_types.Has(DICTIONARY)); |
278 } | 279 } |
279 | 280 |
280 ModelTypeSet GetEncryptedTypesFromNigori( | 281 ModelTypeSet GetEncryptedTypesFromNigori( |
281 const sync_pb::NigoriSpecifics& nigori) { | 282 const sync_pb::NigoriSpecifics& nigori) { |
282 if (nigori.encrypt_everything()) | 283 if (nigori.encrypt_everything()) |
283 return ModelTypeSet::All(); | 284 return ModelTypeSet::All(); |
284 | 285 |
285 ModelTypeSet encrypted_types; | 286 ModelTypeSet encrypted_types; |
286 COMPILE_ASSERT(17, MODEL_TYPE_COUNT); | 287 COMPILE_ASSERT(17, MODEL_TYPE_COUNT); |
287 if (nigori.encrypt_bookmarks()) | 288 if (nigori.encrypt_bookmarks()) |
(...skipping 15 matching lines...) Expand all Loading... |
303 if (nigori.encrypt_search_engines()) | 304 if (nigori.encrypt_search_engines()) |
304 encrypted_types.Put(SEARCH_ENGINES); | 305 encrypted_types.Put(SEARCH_ENGINES); |
305 if (nigori.encrypt_sessions()) | 306 if (nigori.encrypt_sessions()) |
306 encrypted_types.Put(SESSIONS); | 307 encrypted_types.Put(SESSIONS); |
307 if (nigori.encrypt_app_settings()) | 308 if (nigori.encrypt_app_settings()) |
308 encrypted_types.Put(APP_SETTINGS); | 309 encrypted_types.Put(APP_SETTINGS); |
309 if (nigori.encrypt_apps()) | 310 if (nigori.encrypt_apps()) |
310 encrypted_types.Put(APPS); | 311 encrypted_types.Put(APPS); |
311 if (nigori.encrypt_app_notifications()) | 312 if (nigori.encrypt_app_notifications()) |
312 encrypted_types.Put(APP_NOTIFICATIONS); | 313 encrypted_types.Put(APP_NOTIFICATIONS); |
| 314 if (nigori.encrypt_dictionary()) |
| 315 encrypted_types.Put(DICTIONARY); |
313 return encrypted_types; | 316 return encrypted_types; |
314 } | 317 } |
315 | 318 |
316 } // namespace syncable | 319 } // namespace syncable |
317 } // namespace syncer | 320 } // namespace syncer |
OLD | NEW |