| 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 login_performer_->ResyncEncryptedData(); | 602 login_performer_->ResyncEncryptedData(); |
| 603 } | 603 } |
| 604 | 604 |
| 605 void ExistingUserController::SetDisplayEmail(const std::string& email) { | 605 void ExistingUserController::SetDisplayEmail(const std::string& email) { |
| 606 display_email_ = email; | 606 display_email_ = email; |
| 607 } | 607 } |
| 608 | 608 |
| 609 void ExistingUserController::ShowWrongHWIDScreen() { | 609 void ExistingUserController::ShowWrongHWIDScreen() { |
| 610 scoped_ptr<base::DictionaryValue> params; | 610 scoped_ptr<base::DictionaryValue> params; |
| 611 host_->StartWizard(WizardController::kWrongHWIDScreenName, params.Pass()); | 611 host_->StartWizard(WizardController::kWrongHWIDScreenName, params.Pass()); |
| 612 login_display_->OnFadeOut(); | |
| 613 } | 612 } |
| 614 | 613 |
| 615 void ExistingUserController::Signout() { | 614 void ExistingUserController::Signout() { |
| 616 NOTREACHED(); | 615 NOTREACHED(); |
| 617 } | 616 } |
| 618 | 617 |
| 619 void ExistingUserController::OnConsumerKioskAutoLaunchCheckCompleted( | 618 void ExistingUserController::OnConsumerKioskAutoLaunchCheckCompleted( |
| 620 KioskAppManager::ConsumerKioskAutoLaunchStatus status) { | 619 KioskAppManager::ConsumerKioskAutoLaunchStatus status) { |
| 621 if (status == KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE) | 620 if (status == KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE) |
| 622 ShowKioskEnableScreen(); | 621 ShowKioskEnableScreen(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 647 void ExistingUserController::ShowEnrollmentScreen(bool is_auto_enrollment, | 646 void ExistingUserController::ShowEnrollmentScreen(bool is_auto_enrollment, |
| 648 const std::string& user) { | 647 const std::string& user) { |
| 649 scoped_ptr<base::DictionaryValue> params; | 648 scoped_ptr<base::DictionaryValue> params; |
| 650 if (is_auto_enrollment) { | 649 if (is_auto_enrollment) { |
| 651 params.reset(new base::DictionaryValue()); | 650 params.reset(new base::DictionaryValue()); |
| 652 params->SetBoolean("is_auto_enrollment", true); | 651 params->SetBoolean("is_auto_enrollment", true); |
| 653 params->SetString("user", user); | 652 params->SetString("user", user); |
| 654 } | 653 } |
| 655 host_->StartWizard(WizardController::kEnrollmentScreenName, | 654 host_->StartWizard(WizardController::kEnrollmentScreenName, |
| 656 params.Pass()); | 655 params.Pass()); |
| 657 login_display_->OnFadeOut(); | |
| 658 } | 656 } |
| 659 | 657 |
| 660 void ExistingUserController::ShowResetScreen() { | 658 void ExistingUserController::ShowResetScreen() { |
| 661 scoped_ptr<base::DictionaryValue> params; | 659 scoped_ptr<base::DictionaryValue> params; |
| 662 host_->StartWizard(WizardController::kResetScreenName, params.Pass()); | 660 host_->StartWizard(WizardController::kResetScreenName, params.Pass()); |
| 663 login_display_->OnFadeOut(); | |
| 664 } | 661 } |
| 665 | 662 |
| 666 void ExistingUserController::ShowKioskEnableScreen() { | 663 void ExistingUserController::ShowKioskEnableScreen() { |
| 667 scoped_ptr<base::DictionaryValue> params; | 664 scoped_ptr<base::DictionaryValue> params; |
| 668 host_->StartWizard(WizardController::kKioskEnableScreenName, params.Pass()); | 665 host_->StartWizard(WizardController::kKioskEnableScreenName, params.Pass()); |
| 669 login_display_->OnFadeOut(); | |
| 670 } | 666 } |
| 671 | 667 |
| 672 void ExistingUserController::ShowKioskAutolaunchScreen() { | 668 void ExistingUserController::ShowKioskAutolaunchScreen() { |
| 673 scoped_ptr<base::DictionaryValue> params; | 669 scoped_ptr<base::DictionaryValue> params; |
| 674 host_->StartWizard(WizardController::kKioskAutolaunchScreenName, | 670 host_->StartWizard(WizardController::kKioskAutolaunchScreenName, |
| 675 params.Pass()); | 671 params.Pass()); |
| 676 login_display_->OnFadeOut(); | |
| 677 } | 672 } |
| 678 | 673 |
| 679 void ExistingUserController::ShowTPMError() { | 674 void ExistingUserController::ShowTPMError() { |
| 680 login_display_->SetUIEnabled(false); | 675 login_display_->SetUIEnabled(false); |
| 681 login_display_->ShowErrorScreen(LoginDisplay::TPM_ERROR); | 676 login_display_->ShowErrorScreen(LoginDisplay::TPM_ERROR); |
| 682 } | 677 } |
| 683 | 678 |
| 684 //////////////////////////////////////////////////////////////////////////////// | 679 //////////////////////////////////////////////////////////////////////////////// |
| 685 // ExistingUserController, LoginPerformer::Delegate implementation: | 680 // ExistingUserController, LoginPerformer::Delegate implementation: |
| 686 // | 681 // |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 ignore_result(login_performer_.release()); | 772 ignore_result(login_performer_.release()); |
| 778 | 773 |
| 779 // Will call OnProfilePrepared() in the end. | 774 // Will call OnProfilePrepared() in the end. |
| 780 LoginUtils::Get()->PrepareProfile(user_context, | 775 LoginUtils::Get()->PrepareProfile(user_context, |
| 781 display_email_, | 776 display_email_, |
| 782 has_cookies, | 777 has_cookies, |
| 783 false, // Start session for user. | 778 false, // Start session for user. |
| 784 this); | 779 this); |
| 785 | 780 |
| 786 display_email_.clear(); | 781 display_email_.clear(); |
| 787 | |
| 788 // Notify LoginDisplay to allow it provide visual feedback to user. | |
| 789 login_display_->OnLoginSuccess(user_context.GetUserID()); | |
| 790 } | 782 } |
| 791 | 783 |
| 792 void ExistingUserController::OnProfilePrepared(Profile* profile) { | 784 void ExistingUserController::OnProfilePrepared(Profile* profile) { |
| 793 // Reenable clicking on other windows and status area. | 785 // Reenable clicking on other windows and status area. |
| 794 login_display_->SetUIEnabled(true); | 786 login_display_->SetUIEnabled(true); |
| 795 | 787 |
| 796 UserManager* user_manager = UserManager::Get(); | 788 UserManager* user_manager = UserManager::Get(); |
| 797 if (user_manager->IsCurrentUserNew() && | 789 if (user_manager->IsCurrentUserNew() && |
| 798 user_manager->IsLoggedInAsLocallyManagedUser()) { | 790 user_manager->IsLoggedInAsLocallyManagedUser()) { |
| 799 // Supervised users should launch into empty desktop on first run. | 791 // Supervised users should launch into empty desktop on first run. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 820 } else { | 812 } else { |
| 821 ActivateWizard(WizardController::kTermsOfServiceScreenName); | 813 ActivateWizard(WizardController::kTermsOfServiceScreenName); |
| 822 } | 814 } |
| 823 } else { | 815 } else { |
| 824 LoginUtils::Get()->DoBrowserLaunch(profile, host_); | 816 LoginUtils::Get()->DoBrowserLaunch(profile, host_); |
| 825 host_ = NULL; | 817 host_ = NULL; |
| 826 } | 818 } |
| 827 // Inform |login_status_consumer_| about successful login. | 819 // Inform |login_status_consumer_| about successful login. |
| 828 if (login_status_consumer_) | 820 if (login_status_consumer_) |
| 829 login_status_consumer_->OnLoginSuccess(UserContext()); | 821 login_status_consumer_->OnLoginSuccess(UserContext()); |
| 830 login_display_->OnFadeOut(); | |
| 831 } | 822 } |
| 832 | 823 |
| 833 void ExistingUserController::OnOffTheRecordLoginSuccess() { | 824 void ExistingUserController::OnOffTheRecordLoginSuccess() { |
| 834 is_login_in_progress_ = false; | 825 is_login_in_progress_ = false; |
| 835 offline_failed_ = false; | 826 offline_failed_ = false; |
| 836 | 827 |
| 837 // Mark the device as registered., i.e. the second part of OOBE as completed. | 828 // Mark the device as registered., i.e. the second part of OOBE as completed. |
| 838 if (!StartupUtils::IsDeviceRegistered()) | 829 if (!StartupUtils::IsDeviceRegistered()) |
| 839 StartupUtils::MarkDeviceRegistered(); | 830 StartupUtils::MarkDeviceRegistered(); |
| 840 | 831 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 } | 1109 } |
| 1119 | 1110 |
| 1120 void ExistingUserController::SendAccessibilityAlert( | 1111 void ExistingUserController::SendAccessibilityAlert( |
| 1121 const std::string& alert_text) { | 1112 const std::string& alert_text) { |
| 1122 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text); | 1113 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text); |
| 1123 SendControlAccessibilityNotification( | 1114 SendControlAccessibilityNotification( |
| 1124 ui::AX_EVENT_VALUE_CHANGED, &event); | 1115 ui::AX_EVENT_VALUE_CHANGED, &event); |
| 1125 } | 1116 } |
| 1126 | 1117 |
| 1127 } // namespace chromeos | 1118 } // namespace chromeos |
| OLD | NEW |