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