| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 32 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 32 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 33 #include "chrome/browser/chromeos/base/locale_util.h" | 33 #include "chrome/browser/chromeos/base/locale_util.h" |
| 34 #include "chrome/browser/chromeos/boot_times_recorder.h" | 34 #include "chrome/browser/chromeos/boot_times_recorder.h" |
| 35 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" | 35 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" |
| 36 #include "chrome/browser/chromeos/first_run/first_run.h" | 36 #include "chrome/browser/chromeos/first_run/first_run.h" |
| 37 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 37 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 38 #include "chrome/browser/chromeos/language_preferences.h" | 38 #include "chrome/browser/chromeos/language_preferences.h" |
| 39 #include "chrome/browser/chromeos/login/arc_kiosk_controller.h" | 39 #include "chrome/browser/chromeos/login/arc_kiosk_controller.h" |
| 40 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 40 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
| 41 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" | |
| 42 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 41 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 43 #include "chrome/browser/chromeos/login/helper.h" | 42 #include "chrome/browser/chromeos/login/helper.h" |
| 44 #include "chrome/browser/chromeos/login/login_wizard.h" | 43 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 45 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h" | 44 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h" |
| 46 #include "chrome/browser/chromeos/login/screens/gaia_view.h" | 45 #include "chrome/browser/chromeos/login/screens/gaia_view.h" |
| 47 #include "chrome/browser/chromeos/login/signin/token_handle_util.h" | 46 #include "chrome/browser/chromeos/login/signin/token_handle_util.h" |
| 48 #include "chrome/browser/chromeos/login/startup_utils.h" | 47 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 49 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 48 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
| 50 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 49 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 51 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 50 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 // Defer the deletion of LoginDisplayHost instance until the user adding | 582 // Defer the deletion of LoginDisplayHost instance until the user adding |
| 584 // animation (which is done by UserSwitchAnimatorChromeOS) is finished. | 583 // animation (which is done by UserSwitchAnimatorChromeOS) is finished. |
| 585 // This is to guarantee OnUserSwitchAnimationFinished() is called before | 584 // This is to guarantee OnUserSwitchAnimationFinished() is called before |
| 586 // LoginDisplayHost deletes itself. | 585 // LoginDisplayHost deletes itself. |
| 587 break; | 586 break; |
| 588 default: | 587 default: |
| 589 break; | 588 break; |
| 590 } | 589 } |
| 591 } | 590 } |
| 592 | 591 |
| 593 void LoginDisplayHostImpl::OnCompleteLogin() { | |
| 594 if (auto_enrollment_controller_) | |
| 595 auto_enrollment_controller_->Cancel(); | |
| 596 } | |
| 597 | |
| 598 void LoginDisplayHostImpl::OpenProxySettings() { | 592 void LoginDisplayHostImpl::OpenProxySettings() { |
| 599 if (login_view_) | 593 if (login_view_) |
| 600 login_view_->OpenProxySettings(); | 594 login_view_->OpenProxySettings(); |
| 601 } | 595 } |
| 602 | 596 |
| 603 void LoginDisplayHostImpl::SetStatusAreaVisible(bool visible) { | 597 void LoginDisplayHostImpl::SetStatusAreaVisible(bool visible) { |
| 604 if (initialize_webui_hidden_) | 598 if (initialize_webui_hidden_) |
| 605 status_area_saved_visibility_ = visible; | 599 status_area_saved_visibility_ = visible; |
| 606 else if (login_view_) | 600 else if (login_view_) |
| 607 login_view_->SetStatusAreaVisible(visible); | 601 login_view_->SetStatusAreaVisible(visible); |
| 608 } | 602 } |
| 609 | 603 |
| 610 AutoEnrollmentController* LoginDisplayHostImpl::GetAutoEnrollmentController() { | |
| 611 if (!auto_enrollment_controller_) | |
| 612 auto_enrollment_controller_.reset(new AutoEnrollmentController()); | |
| 613 return auto_enrollment_controller_.get(); | |
| 614 } | |
| 615 | |
| 616 void LoginDisplayHostImpl::StartWizard(OobeScreen first_screen) { | 604 void LoginDisplayHostImpl::StartWizard(OobeScreen first_screen) { |
| 617 DisableKeyboardOverscroll(); | 605 DisableKeyboardOverscroll(); |
| 618 | 606 |
| 619 startup_sound_honors_spoken_feedback_ = false; | 607 startup_sound_honors_spoken_feedback_ = false; |
| 620 TryToPlayStartupSound(); | 608 TryToPlayStartupSound(); |
| 621 | 609 |
| 622 // Keep parameters to restore if renderer crashes. | 610 // Keep parameters to restore if renderer crashes. |
| 623 restore_path_ = RESTORE_WIZARD; | 611 restore_path_ = RESTORE_WIZARD; |
| 624 first_screen_ = first_screen; | 612 first_screen_ = first_screen; |
| 625 is_showing_login_ = false; | 613 is_showing_login_ = false; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 if (!signin_screen_controller_.get()) { | 753 if (!signin_screen_controller_.get()) { |
| 766 signin_screen_controller_.reset(new SignInScreenController( | 754 signin_screen_controller_.reset(new SignInScreenController( |
| 767 GetOobeUI(), webui_login_display_->delegate())); | 755 GetOobeUI(), webui_login_display_->delegate())); |
| 768 } | 756 } |
| 769 | 757 |
| 770 oobe_progress_bar_visible_ = !StartupUtils::IsDeviceRegistered(); | 758 oobe_progress_bar_visible_ = !StartupUtils::IsDeviceRegistered(); |
| 771 SetOobeProgressBarVisible(oobe_progress_bar_visible_); | 759 SetOobeProgressBarVisible(oobe_progress_bar_visible_); |
| 772 SetStatusAreaVisible(true); | 760 SetStatusAreaVisible(true); |
| 773 existing_user_controller_->Init(users); | 761 existing_user_controller_->Init(users); |
| 774 | 762 |
| 775 // We might be here after a reboot that was triggered after OOBE was complete, | |
| 776 // so check for auto-enrollment again. This might catch a cached decision from | |
| 777 // a previous oobe flow, or might start a new check with the server. | |
| 778 GetAutoEnrollmentController()->Start(); | |
| 779 | |
| 780 // Initiate mobile config load. | 763 // Initiate mobile config load. |
| 781 MobileConfig::GetInstance(); | 764 MobileConfig::GetInstance(); |
| 782 | 765 |
| 783 // Initiate device policy fetching. | 766 // Initiate device policy fetching. |
| 784 policy::BrowserPolicyConnectorChromeOS* connector = | 767 policy::BrowserPolicyConnectorChromeOS* connector = |
| 785 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 768 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 786 connector->ScheduleServiceInitialization( | 769 connector->ScheduleServiceInitialization( |
| 787 kPolicyServiceInitializationDelayMilliseconds); | 770 kPolicyServiceInitializationDelayMilliseconds); |
| 788 | 771 |
| 789 CHECK(webui_login_display_); | 772 CHECK(webui_login_display_); |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1484 // Chrome locale. Otherwise it will be lost if Chrome restarts. | 1467 // Chrome locale. Otherwise it will be lost if Chrome restarts. |
| 1485 // Don't need to schedule pref save because setting initial local | 1468 // Don't need to schedule pref save because setting initial local |
| 1486 // will enforce preference saving. | 1469 // will enforce preference saving. |
| 1487 prefs->SetString(prefs::kApplicationLocale, locale); | 1470 prefs->SetString(prefs::kApplicationLocale, locale); |
| 1488 StartupUtils::SetInitialLocale(locale); | 1471 StartupUtils::SetInitialLocale(locale); |
| 1489 | 1472 |
| 1490 TriggerShowLoginWizardFinish(locale, std::move(data)); | 1473 TriggerShowLoginWizardFinish(locale, std::move(data)); |
| 1491 } | 1474 } |
| 1492 | 1475 |
| 1493 } // namespace chromeos | 1476 } // namespace chromeos |
| OLD | NEW |