| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/base64.h" | 5 #include "base/base64.h" |
| 6 #include "chrome/browser/sync/util/cryptographer.h" | 6 #include "chrome/browser/sync/util/cryptographer.h" |
| 7 #include "chrome/browser/password_manager/encryptor.h" | 7 #include "chrome/browser/password_manager/encryptor.h" |
| 8 | 8 |
| 9 namespace browser_sync { | 9 namespace browser_sync { |
| 10 | 10 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 if (nigori.encrypt_preferences()) | 284 if (nigori.encrypt_preferences()) |
| 285 encrypted_types_.insert(syncable::PREFERENCES); | 285 encrypted_types_.insert(syncable::PREFERENCES); |
| 286 if (nigori.encrypt_autofill_profile()) | 286 if (nigori.encrypt_autofill_profile()) |
| 287 encrypted_types_.insert(syncable::AUTOFILL_PROFILE); | 287 encrypted_types_.insert(syncable::AUTOFILL_PROFILE); |
| 288 if (nigori.encrypt_autofill()) | 288 if (nigori.encrypt_autofill()) |
| 289 encrypted_types_.insert(syncable::AUTOFILL); | 289 encrypted_types_.insert(syncable::AUTOFILL); |
| 290 if (nigori.encrypt_themes()) | 290 if (nigori.encrypt_themes()) |
| 291 encrypted_types_.insert(syncable::THEMES); | 291 encrypted_types_.insert(syncable::THEMES); |
| 292 if (nigori.encrypt_typed_urls()) | 292 if (nigori.encrypt_typed_urls()) |
| 293 encrypted_types_.insert(syncable::TYPED_URLS); | 293 encrypted_types_.insert(syncable::TYPED_URLS); |
| 294 if (nigori.encrypt_extension_settings()) |
| 295 encrypted_types_.insert(syncable::EXTENSION_SETTINGS); |
| 294 if (nigori.encrypt_extensions()) | 296 if (nigori.encrypt_extensions()) |
| 295 encrypted_types_.insert(syncable::EXTENSIONS); | 297 encrypted_types_.insert(syncable::EXTENSIONS); |
| 296 if (nigori.encrypt_search_engines()) | 298 if (nigori.encrypt_search_engines()) |
| 297 encrypted_types_.insert(syncable::SEARCH_ENGINES); | 299 encrypted_types_.insert(syncable::SEARCH_ENGINES); |
| 298 if (nigori.encrypt_sessions()) | 300 if (nigori.encrypt_sessions()) |
| 299 encrypted_types_.insert(syncable::SESSIONS); | 301 encrypted_types_.insert(syncable::SESSIONS); |
| 300 if (nigori.encrypt_apps()) | 302 if (nigori.encrypt_apps()) |
| 301 encrypted_types_.insert(syncable::APPS); | 303 encrypted_types_.insert(syncable::APPS); |
| 302 | 304 |
| 303 // Note: the initial version with encryption did not support the | 305 // Note: the initial version with encryption did not support the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 317 nigori->set_encrypt_bookmarks( | 319 nigori->set_encrypt_bookmarks( |
| 318 encrypted_types_.count(syncable::BOOKMARKS) > 0); | 320 encrypted_types_.count(syncable::BOOKMARKS) > 0); |
| 319 nigori->set_encrypt_preferences( | 321 nigori->set_encrypt_preferences( |
| 320 encrypted_types_.count(syncable::PREFERENCES) > 0); | 322 encrypted_types_.count(syncable::PREFERENCES) > 0); |
| 321 nigori->set_encrypt_autofill_profile( | 323 nigori->set_encrypt_autofill_profile( |
| 322 encrypted_types_.count(syncable::AUTOFILL_PROFILE) > 0); | 324 encrypted_types_.count(syncable::AUTOFILL_PROFILE) > 0); |
| 323 nigori->set_encrypt_autofill(encrypted_types_.count(syncable::AUTOFILL) > 0); | 325 nigori->set_encrypt_autofill(encrypted_types_.count(syncable::AUTOFILL) > 0); |
| 324 nigori->set_encrypt_themes(encrypted_types_.count(syncable::THEMES) > 0); | 326 nigori->set_encrypt_themes(encrypted_types_.count(syncable::THEMES) > 0); |
| 325 nigori->set_encrypt_typed_urls( | 327 nigori->set_encrypt_typed_urls( |
| 326 encrypted_types_.count(syncable::TYPED_URLS) > 0); | 328 encrypted_types_.count(syncable::TYPED_URLS) > 0); |
| 329 nigori->set_encrypt_extension_settings( |
| 330 encrypted_types_.count(syncable::EXTENSION_SETTINGS) > 0); |
| 327 nigori->set_encrypt_extensions( | 331 nigori->set_encrypt_extensions( |
| 328 encrypted_types_.count(syncable::EXTENSIONS) > 0); | 332 encrypted_types_.count(syncable::EXTENSIONS) > 0); |
| 329 nigori->set_encrypt_search_engines( | 333 nigori->set_encrypt_search_engines( |
| 330 encrypted_types_.count(syncable::SEARCH_ENGINES) > 0); | 334 encrypted_types_.count(syncable::SEARCH_ENGINES) > 0); |
| 331 nigori->set_encrypt_sessions(encrypted_types_.count(syncable::SESSIONS) > 0); | 335 nigori->set_encrypt_sessions(encrypted_types_.count(syncable::SESSIONS) > 0); |
| 332 nigori->set_encrypt_apps(encrypted_types_.count(syncable::APPS) > 0); | 336 nigori->set_encrypt_apps(encrypted_types_.count(syncable::APPS) > 0); |
| 333 } | 337 } |
| 334 | 338 |
| 335 void Cryptographer::set_encrypt_everything() { | 339 void Cryptographer::set_encrypt_everything() { |
| 336 encrypt_everything_ = true; | 340 encrypt_everything_ = true; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 364 continue; | 368 continue; |
| 365 } | 369 } |
| 366 nigoris_[key.name()] = make_linked_ptr(new_nigori.release()); | 370 nigoris_[key.name()] = make_linked_ptr(new_nigori.release()); |
| 367 } | 371 } |
| 368 } | 372 } |
| 369 DCHECK(nigoris_.end() != nigoris_.find(default_key_name)); | 373 DCHECK(nigoris_.end() != nigoris_.find(default_key_name)); |
| 370 default_nigori_ = &*nigoris_.find(default_key_name); | 374 default_nigori_ = &*nigoris_.find(default_key_name); |
| 371 } | 375 } |
| 372 | 376 |
| 373 } // namespace browser_sync | 377 } // namespace browser_sync |
| OLD | NEW |