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

Unified Diff: chrome/browser/sync/profile_sync_service.h

Issue 6902101: Refactor sync passphrase setup flow and fix passphrase tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: de Morgan's law simplification. 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/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 05aa410b3da09174ed2ff9a1d4deae2c9fadef1e..a0e1cb89e3f2917a031115bc9ecaf051d9e0dd87 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -195,7 +195,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
virtual void OnClearServerDataFailed();
virtual void OnClearServerDataTimeout();
virtual void OnClearServerDataSucceeded();
- virtual void OnPassphraseRequired(bool for_decryption);
+ virtual void OnPassphraseRequired(sync_api::PassphraseRequiredReason reason);
virtual void OnPassphraseAccepted();
virtual void OnEncryptionComplete(
const syncable::ModelTypeSet& encrypted_types);
@@ -282,12 +282,14 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
return is_auth_in_progress_;
}
- bool observed_passphrase_required() const {
- return observed_passphrase_required_;
+ // Returns true if OnPassphraseRequired has been called for any reason.
+ bool ObservedPassphraseRequired() const {
+ return passphrase_required_reason_ !=
+ sync_api::REASON_PASSPHRASE_NOT_REQUIRED;
}
- bool passphrase_required_for_decryption() const {
- return passphrase_required_for_decryption_;
+ sync_api::PassphraseRequiredReason passphrase_required_reason() const {
+ return passphrase_required_reason_;
}
// Returns a user-friendly string form of last synced time (in minutes).
@@ -509,13 +511,10 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// Cache of the last name the client attempted to authenticate.
std::string last_attempted_user_email_;
- // Whether we have seen a SYNC_PASSPHRASE_REQUIRED since initializing the
- // backend, telling us that it is safe to send a passphrase down ASAP.
- bool observed_passphrase_required_;
-
// Was the last SYNC_PASSPHRASE_REQUIRED notification sent because it
- // was required for decryption?
- bool passphrase_required_for_decryption_;
+ // was required for encryption, decryption with a cached passphrase, or
+ // because a new passphrase is required?
+ sync_api::PassphraseRequiredReason passphrase_required_reason_;
// Is the user in a passphrase migration?
bool passphrase_migration_in_progress_;

Powered by Google App Engine
This is Rietveld 408576698