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

Unified Diff: sync/test/fake_sync_encryption_handler.cc

Issue 10824410: [Sync] Refactor passphrase state handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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
« no previous file with comments | « sync/test/fake_sync_encryption_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_sync_encryption_handler.cc
diff --git a/sync/test/fake_sync_encryption_handler.cc b/sync/test/fake_sync_encryption_handler.cc
index c589558c4e406eff8f30574dc5bc1bf41dd893db..fd41a5c0ba2d96549464e0613c3be01343844b8f 100644
--- a/sync/test/fake_sync_encryption_handler.cc
+++ b/sync/test/fake_sync_encryption_handler.cc
@@ -12,7 +12,7 @@ namespace syncer {
FakeSyncEncryptionHandler::FakeSyncEncryptionHandler()
: encrypted_types_(SensitiveTypes()),
encrypt_everything_(false),
- explicit_passphrase_(false),
+ passphrase_state_(IMPLICIT_PASSPHRASE),
cryptographer_(&encryptor_) {
}
FakeSyncEncryptionHandler::~FakeSyncEncryptionHandler() {}
@@ -27,7 +27,7 @@ void FakeSyncEncryptionHandler::ApplyNigoriUpdate(
if (nigori.encrypt_everything())
EnableEncryptEverything();
if (nigori.using_explicit_passphrase())
- explicit_passphrase_ = true;
+ passphrase_state_ = CUSTOM_PASSPHRASE;
if (cryptographer_.CanDecrypt(nigori.encrypted()))
cryptographer_.InstallKeys(nigori.encrypted());
@@ -74,7 +74,7 @@ void FakeSyncEncryptionHandler::SetEncryptionPassphrase(
const std::string& passphrase,
bool is_explicit) {
if (is_explicit)
- explicit_passphrase_ = true;
+ passphrase_state_ = CUSTOM_PASSPHRASE;
}
void FakeSyncEncryptionHandler::SetDecryptionPassphrase(
@@ -96,8 +96,8 @@ bool FakeSyncEncryptionHandler::EncryptEverythingEnabled() const {
return encrypt_everything_;
}
-bool FakeSyncEncryptionHandler::IsUsingExplicitPassphrase() const {
- return explicit_passphrase_;
+PassphraseState FakeSyncEncryptionHandler::GetPassphraseState() const {
+ return passphrase_state_;
}
} // namespace syncer
« no previous file with comments | « sync/test/fake_sync_encryption_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698