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