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

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

Issue 324463003: ChromeOS login webui refactoring : Simplify login methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 374 }
375 375
376 base::string16 ExistingUserController::GetConnectedNetworkName() { 376 base::string16 ExistingUserController::GetConnectedNetworkName() {
377 return network_state_helper_->GetCurrentNetworkName(); 377 return network_state_helper_->GetCurrentNetworkName();
378 } 378 }
379 379
380 bool ExistingUserController::IsSigninInProgress() const { 380 bool ExistingUserController::IsSigninInProgress() const {
381 return is_login_in_progress_; 381 return is_login_in_progress_;
382 } 382 }
383 383
384 void ExistingUserController::Login(const UserContext& user_context) { 384 void ExistingUserController::Login(const UserContext& user_context,
385 const SigninSpecifics& specifics) {
386 if (user_context.GetUserType() == User::USER_TYPE_GUEST) {
387 LoginAsGuest();
388 return;
389 }
390 if (user_context.GetUserType() == User::USER_TYPE_PUBLIC_ACCOUNT) {
Nikita (slow) 2014/06/06 14:49:47 nit: else if here and below.
Denis Kuznetsov (DE-MUC) 2014/06/06 15:18:42 Done.
391 LoginAsPublicAccount(user_context.GetUserID());
392 return;
393 }
394 if (user_context.GetUserType() == User::USER_TYPE_RETAIL_MODE) {
395 LoginAsRetailModeUser();
396 return;
397 }
398 if (user_context.GetUserType() == User::USER_TYPE_KIOSK_APP) {
399 LoginAsKioskApp(user_context.GetUserID(), specifics.kiosk_diagnostic_mode);
400 return;
401 }
385 if (!user_context.HasCredentials()) 402 if (!user_context.HasCredentials())
386 return; 403 return;
387 404
388 // Stop the auto-login timer when attempting login. 405 // Stop the auto-login timer when attempting login.
389 StopPublicSessionAutoLoginTimer(); 406 StopPublicSessionAutoLoginTimer();
390 407
391 // Disable clicking on other windows. 408 // Disable clicking on other windows.
392 login_display_->SetUIEnabled(false); 409 login_display_->SetUIEnabled(false);
393 410
394 if (last_login_attempt_username_ != user_context.GetUserID()) { 411 if (last_login_attempt_username_ != user_context.GetUserID()) {
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 } 1130 }
1114 1131
1115 void ExistingUserController::SendAccessibilityAlert( 1132 void ExistingUserController::SendAccessibilityAlert(
1116 const std::string& alert_text) { 1133 const std::string& alert_text) {
1117 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text); 1134 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text);
1118 SendControlAccessibilityNotification( 1135 SendControlAccessibilityNotification(
1119 ui::AX_EVENT_VALUE_CHANGED, &event); 1136 ui::AX_EVENT_VALUE_CHANGED, &event);
1120 } 1137 }
1121 1138
1122 } // namespace chromeos 1139 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698