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/internal_api/sync_manager.h" | 5 #include "chrome/browser/sync/internal_api/sync_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 // encrypted types or that we require a passphrase. | 1586 // encrypted types or that we require a passphrase. |
1587 sync_api::ReadTransaction trans(FROM_HERE, GetUserShare()); | 1587 sync_api::ReadTransaction trans(FROM_HERE, GetUserShare()); |
1588 Cryptographer* cryptographer = trans.GetCryptographer(); | 1588 Cryptographer* cryptographer = trans.GetCryptographer(); |
1589 // If we've completed a sync cycle and the cryptographer isn't ready | 1589 // If we've completed a sync cycle and the cryptographer isn't ready |
1590 // yet, prompt the user for a passphrase. | 1590 // yet, prompt the user for a passphrase. |
1591 if (cryptographer->has_pending_keys()) { | 1591 if (cryptographer->has_pending_keys()) { |
1592 DVLOG(1) << "OnPassPhraseRequired Sent"; | 1592 DVLOG(1) << "OnPassPhraseRequired Sent"; |
1593 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 1593 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
1594 OnPassphraseRequired(sync_api::REASON_DECRYPTION)); | 1594 OnPassphraseRequired(sync_api::REASON_DECRYPTION)); |
1595 } else if (!cryptographer->is_ready() && | 1595 } else if (!cryptographer->is_ready() && |
1596 event.snapshot->initial_sync_ended.test(syncable::NIGORI)) { | 1596 event.snapshot->initial_sync_ended.Has(syncable::NIGORI)) { |
1597 DVLOG(1) << "OnPassphraseRequired sent because cryptographer is not " | 1597 DVLOG(1) << "OnPassphraseRequired sent because cryptographer is not " |
1598 << "ready"; | 1598 << "ready"; |
1599 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 1599 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
1600 OnPassphraseRequired(sync_api::REASON_ENCRYPTION)); | 1600 OnPassphraseRequired(sync_api::REASON_ENCRYPTION)); |
1601 } | 1601 } |
1602 | 1602 |
1603 allstatus_.SetCryptographerReady(cryptographer->is_ready()); | 1603 allstatus_.SetCryptographerReady(cryptographer->is_ready()); |
1604 allstatus_.SetCryptoHasPendingKeys(cryptographer->has_pending_keys()); | 1604 allstatus_.SetCryptoHasPendingKeys(cryptographer->has_pending_keys()); |
1605 allstatus_.SetEncryptedTypes(cryptographer->GetEncryptedTypes()); | 1605 allstatus_.SetEncryptedTypes(cryptographer->GetEncryptedTypes()); |
1606 } | 1606 } |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2078 lookup->GetDownloadProgress(*i, &marker); | 2078 lookup->GetDownloadProgress(*i, &marker); |
2079 | 2079 |
2080 if (marker.token().empty()) | 2080 if (marker.token().empty()) |
2081 result.insert(*i); | 2081 result.insert(*i); |
2082 | 2082 |
2083 } | 2083 } |
2084 return result; | 2084 return result; |
2085 } | 2085 } |
2086 | 2086 |
2087 } // namespace sync_api | 2087 } // namespace sync_api |
OLD | NEW |