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

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

Issue 2314913003: Deprecate HOSTED_NOT_ALLOWED auth error (Closed)
Patch Set: Replace NUM_DEPRECATED_STATES with IsDeprecated() Created 4 years, 3 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
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 <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 // cached locally or the local admin account. 598 // cached locally or the local admin account.
599 const bool is_known_user = user_manager::UserManager::Get()->IsKnownUser( 599 const bool is_known_user = user_manager::UserManager::Get()->IsKnownUser(
600 last_login_attempt_account_id_); 600 last_login_attempt_account_id_);
601 if (!network_state_helper_->IsConnected()) { 601 if (!network_state_helper_->IsConnected()) {
602 if (is_known_user) 602 if (is_known_user)
603 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error); 603 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error);
604 else 604 else
605 ShowError(IDS_LOGIN_ERROR_OFFLINE_FAILED_NETWORK_NOT_CONNECTED, error); 605 ShowError(IDS_LOGIN_ERROR_OFFLINE_FAILED_NETWORK_NOT_CONNECTED, error);
606 } else { 606 } else {
607 // TODO(nkostylev): Cleanup rest of ClientLogin related code. 607 // TODO(nkostylev): Cleanup rest of ClientLogin related code.
608 if (failure.reason() == AuthFailure::NETWORK_AUTH_FAILED && 608 if (!is_known_user)
609 failure.error().state() == 609 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING_NEW, error);
610 GoogleServiceAuthError::HOSTED_NOT_ALLOWED) { 610 else
611 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING_HOSTED, error); 611 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error);
612 } else {
613 if (!is_known_user)
614 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING_NEW, error);
615 else
616 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error);
617 }
618 } 612 }
619 if (auth_flow_offline_) 613 if (auth_flow_offline_)
620 UMA_HISTOGRAM_BOOLEAN("Login.OfflineFailure.IsKnownUser", is_known_user); 614 UMA_HISTOGRAM_BOOLEAN("Login.OfflineFailure.IsKnownUser", is_known_user);
621 615
622 login_display_->ClearAndEnablePassword(); 616 login_display_->ClearAndEnablePassword();
623 StartPublicSessionAutoLoginTimer(); 617 StartPublicSessionAutoLoginTimer();
624 } 618 }
625 619
626 // Reset user flow to default, so that special flow will not affect next 620 // Reset user flow to default, so that special flow will not affect next
627 // attempt. 621 // attempt.
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 985
992 void ExistingUserController::ShowError(int error_id, 986 void ExistingUserController::ShowError(int error_id,
993 const std::string& details) { 987 const std::string& details) {
994 VLOG(1) << details; 988 VLOG(1) << details;
995 HelpAppLauncher::HelpTopic help_topic_id; 989 HelpAppLauncher::HelpTopic help_topic_id;
996 if (login_performer_) { 990 if (login_performer_) {
997 switch (login_performer_->error().state()) { 991 switch (login_performer_->error().state()) {
998 case GoogleServiceAuthError::ACCOUNT_DISABLED: 992 case GoogleServiceAuthError::ACCOUNT_DISABLED:
999 help_topic_id = HelpAppLauncher::HELP_ACCOUNT_DISABLED; 993 help_topic_id = HelpAppLauncher::HELP_ACCOUNT_DISABLED;
1000 break; 994 break;
1001 case GoogleServiceAuthError::HOSTED_NOT_ALLOWED:
1002 help_topic_id = HelpAppLauncher::HELP_HOSTED_ACCOUNT;
1003 break;
1004 default: 995 default:
1005 help_topic_id = HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT; 996 help_topic_id = HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT;
1006 break; 997 break;
1007 } 998 }
1008 } else { 999 } else {
1009 // login_performer_ will be null if an error occurred during OAuth2 token 1000 // login_performer_ will be null if an error occurred during OAuth2 token
1010 // fetch. In this case, show a generic error. 1001 // fetch. In this case, show a generic error.
1011 help_topic_id = HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT; 1002 help_topic_id = HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT;
1012 } 1003 }
1013 1004
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 } 1262 }
1272 1263
1273 // Otherwise, show the unrecoverable cryptohome error UI and ask user's 1264 // Otherwise, show the unrecoverable cryptohome error UI and ask user's
1274 // permission to collect a feedback. 1265 // permission to collect a feedback.
1275 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE); 1266 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE);
1276 VLOG(1) << "Show unrecoverable cryptohome error dialog."; 1267 VLOG(1) << "Show unrecoverable cryptohome error dialog.";
1277 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); 1268 login_display_->ShowUnrecoverableCrypthomeErrorDialog();
1278 } 1269 }
1279 1270
1280 } // namespace chromeos 1271 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698