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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 1114543002: UMA to track the reason for re-auth (draft). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fixes. Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/reauth_stats.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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) {
580 RecordReauthReason(last_login_attempt_username_,
581 ReauthReason::MISSING_CRYPTOHOME);
582 }
583 */
575 } 584 }
576 585
577 void ExistingUserController::OnAuthSuccess(const UserContext& user_context) { 586 void ExistingUserController::OnAuthSuccess(const UserContext& user_context) {
578 is_login_in_progress_ = false; 587 is_login_in_progress_ = false;
579 offline_failed_ = false; 588 offline_failed_ = false;
580 login_display_->set_signin_completed(true); 589 login_display_->set_signin_completed(true);
581 590
582 // Login performer will be gone so cache this value to use 591 // Login performer will be gone so cache this value to use
583 // once profile is loaded. 592 // once profile is loaded.
584 password_changed_ = login_performer_->password_changed(); 593 password_changed_ = login_performer_->password_changed();
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 978
970 login_display_->ShowError(error_id, num_login_attempts_, help_topic_id); 979 login_display_->ShowError(error_id, num_login_attempts_, help_topic_id);
971 } 980 }
972 981
973 void ExistingUserController::ShowGaiaPasswordChanged( 982 void ExistingUserController::ShowGaiaPasswordChanged(
974 const std::string& username) { 983 const std::string& username) {
975 // Invalidate OAuth token, since it can't be correct after password is 984 // Invalidate OAuth token, since it can't be correct after password is
976 // changed. 985 // changed.
977 user_manager::UserManager::Get()->SaveUserOAuthStatus( 986 user_manager::UserManager::Get()->SaveUserOAuthStatus(
978 username, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID); 987 username, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
988 RecordReauthReason(username, ReauthReason::OTHER);
979 989
980 login_display_->SetUIEnabled(true); 990 login_display_->SetUIEnabled(true);
981 login_display_->ShowGaiaPasswordChanged(username); 991 login_display_->ShowGaiaPasswordChanged(username);
982 } 992 }
983 993
984 void ExistingUserController::SendAccessibilityAlert( 994 void ExistingUserController::SendAccessibilityAlert(
985 const std::string& alert_text) { 995 const std::string& alert_text) {
986 AutomationManagerAura::GetInstance()->HandleAlert( 996 AutomationManagerAura::GetInstance()->HandleAlert(
987 ProfileHelper::GetSigninProfile(), alert_text); 997 ProfileHelper::GetSigninProfile(), alert_text);
988 } 998 }
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 const UserContext& user_context) { 1227 const UserContext& user_context) {
1218 if (!success) { 1228 if (!success) {
1219 LOG(ERROR) << "OAuth2 token fetch failed."; 1229 LOG(ERROR) << "OAuth2 token fetch failed.";
1220 OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED)); 1230 OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED));
1221 return; 1231 return;
1222 } 1232 }
1223 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); 1233 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION);
1224 } 1234 }
1225 1235
1226 } // namespace chromeos 1236 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/reauth_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698