Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(917)

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 6902101: Refactor sync passphrase setup flow and fix passphrase tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove OnPassphraseFailed; Plumb enum all the way through; Shave yak. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/engine/syncapi.cc
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 9ad111dd9523ec5a3d8f5d3cb2aa0083d2794503..2c0fe382b01ade122415a334dc1f0511883248ac 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -1791,7 +1791,7 @@ void SyncManager::SyncInternal::BootstrapEncryption(
} else {
cryptographer->SetPendingKeys(nigori.encrypted());
FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
- OnPassphraseRequired(true));
+ OnPassphraseRequired(sync_api::DECRYPTION));
}
}
}
@@ -1953,7 +1953,7 @@ void SyncManager::SyncInternal::SetPassphrase(
if (!cryptographer->DecryptPendingKeys(params)) {
VLOG(1) << "Passphrase failed to decrypt pending keys.";
FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
- OnPassphraseFailed());
+ OnPassphraseRequired(sync_api::DECRYPTION_FAILED));
return;
}
@@ -2506,10 +2506,10 @@ void SyncManager::SyncInternal::OnSyncEngineEvent(
// yet, prompt the user for a passphrase.
if (cryptographer->has_pending_keys()) {
FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
- OnPassphraseRequired(true));
+ OnPassphraseRequired(sync_api::ENCRYPTION));
} else if (!cryptographer->is_ready()) {
FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
- OnPassphraseRequired(false));
+ OnPassphraseRequired(sync_api::DECRYPTION));
} else {
FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
OnEncryptionComplete(encrypted_types));

Powered by Google App Engine
This is Rietveld 408576698