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