| 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 "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 cached_passphrases_.gaia_passphrase = passphrase; | 1330 cached_passphrases_.gaia_passphrase = passphrase; |
| 1331 } | 1331 } |
| 1332 } | 1332 } |
| 1333 } | 1333 } |
| 1334 | 1334 |
| 1335 void ProfileSyncService::SetEncryptEverything(bool encrypt_everything) { | 1335 void ProfileSyncService::SetEncryptEverything(bool encrypt_everything) { |
| 1336 // Tests override sync_initialized() to always return true, so we | 1336 // Tests override sync_initialized() to always return true, so we |
| 1337 // must check that instead of |backend_initialized_|. | 1337 // must check that instead of |backend_initialized_|. |
| 1338 // TODO(akalin): Fix the above. :/ | 1338 // TODO(akalin): Fix the above. :/ |
| 1339 DCHECK(sync_initialized()); | 1339 DCHECK(sync_initialized()); |
| 1340 encryption_pending_ = encrypt_everything; | |
| 1341 // Callers shouldn't try to disable encrypt everything once it has | 1340 // Callers shouldn't try to disable encrypt everything once it has |
| 1342 // already succeeded. | 1341 // already succeeded. |
| 1343 DCHECK(!encrypt_everything_); | 1342 if (!encrypt_everything) |
| 1343 DCHECK(!encrypt_everything_); |
| 1344 encryption_pending_ = encrypt_everything; |
| 1344 } | 1345 } |
| 1345 | 1346 |
| 1346 bool ProfileSyncService::encryption_pending() const { | 1347 bool ProfileSyncService::encryption_pending() const { |
| 1347 // We may be called during the setup process before we're | 1348 // We may be called during the setup process before we're |
| 1348 // initialized (via IsEncryptedDatatypeEnabled and | 1349 // initialized (via IsEncryptedDatatypeEnabled and |
| 1349 // IsPassphraseRequiredForDecryption). | 1350 // IsPassphraseRequiredForDecryption). |
| 1350 return encryption_pending_; | 1351 return encryption_pending_; |
| 1351 } | 1352 } |
| 1352 | 1353 |
| 1353 bool ProfileSyncService::EncryptEverythingEnabled() const { | 1354 bool ProfileSyncService::EncryptEverythingEnabled() const { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 << "Unrecoverable error."; | 1542 << "Unrecoverable error."; |
| 1542 } else { | 1543 } else { |
| 1543 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " | 1544 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " |
| 1544 << "initialized"; | 1545 << "initialized"; |
| 1545 } | 1546 } |
| 1546 } | 1547 } |
| 1547 | 1548 |
| 1548 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { | 1549 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { |
| 1549 return failed_datatypes_handler_; | 1550 return failed_datatypes_handler_; |
| 1550 } | 1551 } |
| OLD | NEW |