Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "base/version.h" | 21 #include "base/version.h" |
| 22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/browser_process_platform_part.h" | 23 #include "chrome/browser/browser_process_platform_part.h" |
| 24 #include "chrome/browser/chrome_notification_types.h" | 24 #include "chrome/browser/chrome_notification_types.h" |
| 25 #include "chrome/browser/chromeos/boot_times_recorder.h" | 25 #include "chrome/browser/chromeos/boot_times_recorder.h" |
| 26 #include "chrome/browser/chromeos/customization/customization_document.h" | 26 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 27 #include "chrome/browser/chromeos/login/auth/chrome_login_performer.h" | 27 #include "chrome/browser/chromeos/login/auth/chrome_login_performer.h" |
| 28 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_context_initi alizer.h" | 28 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_context_initi alizer.h" |
| 29 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_flow.h" | 29 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_flow.h" |
| 30 #include "chrome/browser/chromeos/login/helper.h" | 30 #include "chrome/browser/chromeos/login/helper.h" |
| 31 #include "chrome/browser/chromeos/login/reauth_stats.h" | |
| 31 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 32 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 32 #include "chrome/browser/chromeos/login/signin/oauth2_token_initializer.h" | 33 #include "chrome/browser/chromeos/login/signin/oauth2_token_initializer.h" |
| 33 #include "chrome/browser/chromeos/login/signin_specifics.h" | 34 #include "chrome/browser/chromeos/login/signin_specifics.h" |
| 34 #include "chrome/browser/chromeos/login/startup_utils.h" | 35 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 35 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 36 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 36 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 37 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| 37 #include "chrome/browser/chromeos/login/user_flow.h" | 38 #include "chrome/browser/chromeos/login/user_flow.h" |
| 38 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 39 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 39 #include "chrome/browser/chromeos/login/wizard_controller.h" | 40 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 40 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 565 | 566 |
| 566 // Reset user flow to default, so that special flow will not affect next | 567 // Reset user flow to default, so that special flow will not affect next |
| 567 // attempt. | 568 // attempt. |
| 568 ChromeUserManager::Get()->ResetUserFlow(last_login_attempt_username_); | 569 ChromeUserManager::Get()->ResetUserFlow(last_login_attempt_username_); |
| 569 | 570 |
| 570 if (auth_status_consumer_) | 571 if (auth_status_consumer_) |
| 571 auth_status_consumer_->OnAuthFailure(failure); | 572 auth_status_consumer_->OnAuthFailure(failure); |
| 572 | 573 |
| 573 // Clear the recorded displayed email so it won't affect any future attempts. | 574 // Clear the recorded displayed email so it won't affect any future attempts. |
| 574 display_email_.clear(); | 575 display_email_.clear(); |
| 576 | |
| 577 // TODO(ginkage): Fix this case once crbug.com/469990 is ready. | |
| 578 /* | |
| 579 if (failure.reason() == AuthFailure::COULD_NOT_MOUNT_CRYPTOHOME) | |
|
Nikita (slow)
2015/04/29 09:21:46
nit: Add {} even though this is just commented cod
Ivan Podogov
2015/04/29 10:34:24
Done.
| |
| 580 RecordReauthReason(last_login_attempt_username_, | |
| 581 ReauthReason::MISSING_CRYPTOHOME); | |
| 582 */ | |
| 575 } | 583 } |
| 576 | 584 |
| 577 void ExistingUserController::OnAuthSuccess(const UserContext& user_context) { | 585 void ExistingUserController::OnAuthSuccess(const UserContext& user_context) { |
| 578 is_login_in_progress_ = false; | 586 is_login_in_progress_ = false; |
| 579 offline_failed_ = false; | 587 offline_failed_ = false; |
| 580 login_display_->set_signin_completed(true); | 588 login_display_->set_signin_completed(true); |
| 581 | 589 |
| 582 // Login performer will be gone so cache this value to use | 590 // Login performer will be gone so cache this value to use |
| 583 // once profile is loaded. | 591 // once profile is loaded. |
| 584 password_changed_ = login_performer_->password_changed(); | 592 password_changed_ = login_performer_->password_changed(); |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 969 | 977 |
| 970 login_display_->ShowError(error_id, num_login_attempts_, help_topic_id); | 978 login_display_->ShowError(error_id, num_login_attempts_, help_topic_id); |
| 971 } | 979 } |
| 972 | 980 |
| 973 void ExistingUserController::ShowGaiaPasswordChanged( | 981 void ExistingUserController::ShowGaiaPasswordChanged( |
| 974 const std::string& username) { | 982 const std::string& username) { |
| 975 // Invalidate OAuth token, since it can't be correct after password is | 983 // Invalidate OAuth token, since it can't be correct after password is |
| 976 // changed. | 984 // changed. |
| 977 user_manager::UserManager::Get()->SaveUserOAuthStatus( | 985 user_manager::UserManager::Get()->SaveUserOAuthStatus( |
| 978 username, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID); | 986 username, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID); |
| 987 RecordReauthReason(username, ReauthReason::OTHER); | |
| 979 | 988 |
| 980 login_display_->SetUIEnabled(true); | 989 login_display_->SetUIEnabled(true); |
| 981 login_display_->ShowGaiaPasswordChanged(username); | 990 login_display_->ShowGaiaPasswordChanged(username); |
| 982 } | 991 } |
| 983 | 992 |
| 984 void ExistingUserController::SendAccessibilityAlert( | 993 void ExistingUserController::SendAccessibilityAlert( |
| 985 const std::string& alert_text) { | 994 const std::string& alert_text) { |
| 986 AutomationManagerAura::GetInstance()->HandleAlert( | 995 AutomationManagerAura::GetInstance()->HandleAlert( |
| 987 ProfileHelper::GetSigninProfile(), alert_text); | 996 ProfileHelper::GetSigninProfile(), alert_text); |
| 988 } | 997 } |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1217 const UserContext& user_context) { | 1226 const UserContext& user_context) { |
| 1218 if (!success) { | 1227 if (!success) { |
| 1219 LOG(ERROR) << "OAuth2 token fetch failed."; | 1228 LOG(ERROR) << "OAuth2 token fetch failed."; |
| 1220 OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED)); | 1229 OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED)); |
| 1221 return; | 1230 return; |
| 1222 } | 1231 } |
| 1223 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); | 1232 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); |
| 1224 } | 1233 } |
| 1225 | 1234 |
| 1226 } // namespace chromeos | 1235 } // namespace chromeos |
| OLD | NEW |