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

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: Attemp to reland (updates in UserContext) 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 if (!specifics.guest_mode_url.empty()) {
388 guest_mode_url_ = GURL(specifics.guest_mode_url);
389 if (specifics.guest_mode_url_append_locale)
390 guest_mode_url_ = google_util::AppendGoogleLocaleParam(guest_mode_url_);
391 }
392 LoginAsGuest();
393 return;
394 } else if (user_context.GetUserType() == User::USER_TYPE_PUBLIC_ACCOUNT) {
395 LoginAsPublicAccount(user_context.GetUserID());
396 return;
397 } else if (user_context.GetUserType() == User::USER_TYPE_RETAIL_MODE) {
398 LoginAsRetailModeUser();
399 return;
400 } else if (user_context.GetUserType() == User::USER_TYPE_KIOSK_APP) {
401 LoginAsKioskApp(user_context.GetUserID(), specifics.kiosk_diagnostic_mode);
402 return;
403 }
404
385 if (!user_context.HasCredentials()) 405 if (!user_context.HasCredentials())
386 return; 406 return;
387 407
388 // Stop the auto-login timer when attempting login. 408 // Stop the auto-login timer when attempting login.
389 StopPublicSessionAutoLoginTimer(); 409 StopPublicSessionAutoLoginTimer();
390 410
391 // Disable clicking on other windows. 411 // Disable clicking on other windows.
392 login_display_->SetUIEnabled(false); 412 login_display_->SetUIEnabled(false);
393 413
394 if (last_login_attempt_username_ != user_context.GetUserID()) { 414 if (last_login_attempt_username_ != user_context.GetUserID()) {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 void ExistingUserController::LoginAsKioskApp(const std::string& app_id, 585 void ExistingUserController::LoginAsKioskApp(const std::string& app_id,
566 bool diagnostic_mode) { 586 bool diagnostic_mode) {
567 host_->StartAppLaunch(app_id, diagnostic_mode); 587 host_->StartAppLaunch(app_id, diagnostic_mode);
568 } 588 }
569 589
570 void ExistingUserController::OnSigninScreenReady() { 590 void ExistingUserController::OnSigninScreenReady() {
571 signin_screen_ready_ = true; 591 signin_screen_ready_ = true;
572 StartPublicSessionAutoLoginTimer(); 592 StartPublicSessionAutoLoginTimer();
573 } 593 }
574 594
575 void ExistingUserController::OnUserSelected(const std::string& username) {
576 login_performer_.reset(NULL);
577 num_login_attempts_ = 0;
578 }
579
580 void ExistingUserController::OnStartEnterpriseEnrollment() { 595 void ExistingUserController::OnStartEnterpriseEnrollment() {
581 if (KioskAppManager::Get()->IsConsumerKioskDeviceWithAutoLaunch()) { 596 if (KioskAppManager::Get()->IsConsumerKioskDeviceWithAutoLaunch()) {
582 LOG(WARNING) << "Enterprise enrollment is not available after kiosk auto " 597 LOG(WARNING) << "Enterprise enrollment is not available after kiosk auto "
583 "launch is set."; 598 "launch is set.";
584 return; 599 return;
585 } 600 }
586 601
587 DeviceSettingsService::Get()->GetOwnershipStatusAsync( 602 DeviceSettingsService::Get()->GetOwnershipStatusAsync(
588 base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted, 603 base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted,
589 weak_factory_.GetWeakPtr())); 604 weak_factory_.GetWeakPtr()));
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 } 1128 }
1114 1129
1115 void ExistingUserController::SendAccessibilityAlert( 1130 void ExistingUserController::SendAccessibilityAlert(
1116 const std::string& alert_text) { 1131 const std::string& alert_text) {
1117 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text); 1132 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text);
1118 SendControlAccessibilityNotification( 1133 SendControlAccessibilityNotification(
1119 ui::AX_EVENT_VALUE_CHANGED, &event); 1134 ui::AX_EVENT_VALUE_CHANGED, &event);
1120 } 1135 }
1121 1136
1122 } // namespace chromeos 1137 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698