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

Unified Diff: chrome/browser/chromeos/login/parallel_authenticator.cc

Issue 7562010: [ChromeOS] Fix login wrong password handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync, fix broken tests and add 3 new Created 9 years, 5 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/chromeos/login/parallel_authenticator.cc
diff --git a/chrome/browser/chromeos/login/parallel_authenticator.cc b/chrome/browser/chromeos/login/parallel_authenticator.cc
index 8f81cb618cc0548ed24988e3b3dc979797e64bd8..0ba94a5fb3c3cf3f9c9390d79d625b1c0cd21b95 100644
--- a/chrome/browser/chromeos/login/parallel_authenticator.cc
+++ b/chrome/browser/chromeos/login/parallel_authenticator.cc
@@ -549,19 +549,28 @@ ParallelAuthenticator::ResolveCryptohomeFailureState() {
return NEED_OLD_PW;
if (key_checker_.get())
return LOGIN_FAILED;
- if (current_state_->cryptohome_code() ==
- chromeos::kCryptohomeMountErrorKeyFailure) {
- // If we tried a mount but they used the wrong key, we may need to
- // ask the user for her old password. We'll only know once we've
- // done the online check.
- return POSSIBLE_PW_CHANGE;
- }
- if (current_state_->cryptohome_code() ==
- chromeos::kCryptohomeMountErrorUserDoesNotExist) {
- // If we tried a mount but the user did not exist, then we should wait
- // for online login to succeed and try again with the "create" flag set.
- return NO_MOUNT;
+
+ // Return intermediate states in the following cases:
+ // 1. When there is a parallel online attempt to resolve them later;
+ // This is the case with legacy ClientLogin flow;
+ // 2. When there is an online result to use;
+ // This is the case after user finishes Gaia login;
+ if (current_online_.get() || current_state_->online_complete()) {
+ if (current_state_->cryptohome_code() ==
+ chromeos::kCryptohomeMountErrorKeyFailure) {
+ // If we tried a mount but they used the wrong key, we may need to
+ // ask the user for her old password. We'll only know once we've
+ // done the online check.
+ return POSSIBLE_PW_CHANGE;
+ }
+ if (current_state_->cryptohome_code() ==
+ chromeos::kCryptohomeMountErrorUserDoesNotExist) {
+ // If we tried a mount but the user did not exist, then we should wait
+ // for online login to succeed and try again with the "create" flag set.
+ return NO_MOUNT;
+ }
}
+
return FAILED_MOUNT;
}

Powered by Google App Engine
This is Rietveld 408576698