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

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

Issue 1132523002: UMA to track the reason for re-auth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: initialize local state 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 984
976 login_display_->ShowError(error_id, num_login_attempts_, help_topic_id); 985 login_display_->ShowError(error_id, num_login_attempts_, help_topic_id);
977 } 986 }
978 987
979 void ExistingUserController::ShowGaiaPasswordChanged( 988 void ExistingUserController::ShowGaiaPasswordChanged(
980 const std::string& username) { 989 const std::string& username) {
981 // Invalidate OAuth token, since it can't be correct after password is 990 // Invalidate OAuth token, since it can't be correct after password is
982 // changed. 991 // changed.
983 user_manager::UserManager::Get()->SaveUserOAuthStatus( 992 user_manager::UserManager::Get()->SaveUserOAuthStatus(
984 username, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID); 993 username, user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
994 RecordReauthReason(username, ReauthReason::OTHER);
985 995
986 login_display_->SetUIEnabled(true); 996 login_display_->SetUIEnabled(true);
987 login_display_->ShowGaiaPasswordChanged(username); 997 login_display_->ShowGaiaPasswordChanged(username);
988 } 998 }
989 999
990 void ExistingUserController::SendAccessibilityAlert( 1000 void ExistingUserController::SendAccessibilityAlert(
991 const std::string& alert_text) { 1001 const std::string& alert_text) {
992 AutomationManagerAura::GetInstance()->HandleAlert( 1002 AutomationManagerAura::GetInstance()->HandleAlert(
993 ProfileHelper::GetSigninProfile(), alert_text); 1003 ProfileHelper::GetSigninProfile(), alert_text);
994 } 1004 }
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 const UserContext& user_context) { 1233 const UserContext& user_context) {
1224 if (!success) { 1234 if (!success) {
1225 LOG(ERROR) << "OAuth2 token fetch failed."; 1235 LOG(ERROR) << "OAuth2 token fetch failed.";
1226 OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN)); 1236 OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN));
1227 return; 1237 return;
1228 } 1238 }
1229 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); 1239 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION);
1230 } 1240 }
1231 1241
1232 } // namespace chromeos 1242 } // 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