| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 // Defer the deletion of LoginDisplayHost instance until the user adding | 565 // Defer the deletion of LoginDisplayHost instance until the user adding |
| 567 // animation (which is done by UserSwitchAnimatorChromeOS) is finished. | 566 // animation (which is done by UserSwitchAnimatorChromeOS) is finished. |
| 568 // This is to guarantee OnUserSwitchAnimationFinished() is called before | 567 // This is to guarantee OnUserSwitchAnimationFinished() is called before |
| 569 // LoginDisplayHost deletes itself. | 568 // LoginDisplayHost deletes itself. |
| 570 break; | 569 break; |
| 571 default: | 570 default: |
| 572 break; | 571 break; |
| 573 } | 572 } |
| 574 } | 573 } |
| 575 | 574 |
| 576 void LoginDisplayHostImpl::OnCompleteLogin() { | |
| 577 if (auto_enrollment_controller_) | |
| 578 auto_enrollment_controller_->Cancel(); | |
| 579 } | |
| 580 | |
| 581 void LoginDisplayHostImpl::OpenProxySettings() { | 575 void LoginDisplayHostImpl::OpenProxySettings() { |
| 582 if (login_view_) | 576 if (login_view_) |
| 583 login_view_->OpenProxySettings(); | 577 login_view_->OpenProxySettings(); |
| 584 } | 578 } |
| 585 | 579 |
| 586 void LoginDisplayHostImpl::SetStatusAreaVisible(bool visible) { | 580 void LoginDisplayHostImpl::SetStatusAreaVisible(bool visible) { |
| 587 if (initialize_webui_hidden_) | 581 if (initialize_webui_hidden_) |
| 588 status_area_saved_visibility_ = visible; | 582 status_area_saved_visibility_ = visible; |
| 589 else if (login_view_) | 583 else if (login_view_) |
| 590 login_view_->SetStatusAreaVisible(visible); | 584 login_view_->SetStatusAreaVisible(visible); |
| 591 } | 585 } |
| 592 | 586 |
| 593 AutoEnrollmentController* LoginDisplayHostImpl::GetAutoEnrollmentController() { | |
| 594 if (!auto_enrollment_controller_) | |
| 595 auto_enrollment_controller_.reset(new AutoEnrollmentController()); | |
| 596 return auto_enrollment_controller_.get(); | |
| 597 } | |
| 598 | |
| 599 void LoginDisplayHostImpl::StartWizard(OobeScreen first_screen) { | 587 void LoginDisplayHostImpl::StartWizard(OobeScreen first_screen) { |
| 600 DisableKeyboardOverscroll(); | 588 DisableKeyboardOverscroll(); |
| 601 | 589 |
| 602 startup_sound_honors_spoken_feedback_ = false; | 590 startup_sound_honors_spoken_feedback_ = false; |
| 603 TryToPlayStartupSound(); | 591 TryToPlayStartupSound(); |
| 604 | 592 |
| 605 // Keep parameters to restore if renderer crashes. | 593 // Keep parameters to restore if renderer crashes. |
| 606 restore_path_ = RESTORE_WIZARD; | 594 restore_path_ = RESTORE_WIZARD; |
| 607 first_screen_ = first_screen; | 595 first_screen_ = first_screen; |
| 608 is_showing_login_ = false; | 596 is_showing_login_ = false; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 if (!signin_screen_controller_.get()) { | 736 if (!signin_screen_controller_.get()) { |
| 749 signin_screen_controller_.reset(new SignInScreenController( | 737 signin_screen_controller_.reset(new SignInScreenController( |
| 750 GetOobeUI(), webui_login_display_->delegate())); | 738 GetOobeUI(), webui_login_display_->delegate())); |
| 751 } | 739 } |
| 752 | 740 |
| 753 oobe_progress_bar_visible_ = !StartupUtils::IsDeviceRegistered(); | 741 oobe_progress_bar_visible_ = !StartupUtils::IsDeviceRegistered(); |
| 754 SetOobeProgressBarVisible(oobe_progress_bar_visible_); | 742 SetOobeProgressBarVisible(oobe_progress_bar_visible_); |
| 755 SetStatusAreaVisible(true); | 743 SetStatusAreaVisible(true); |
| 756 existing_user_controller_->Init(users); | 744 existing_user_controller_->Init(users); |
| 757 | 745 |
| 758 // We might be here after a reboot that was triggered after OOBE was complete, | |
| 759 // so check for auto-enrollment again. This might catch a cached decision from | |
| 760 // a previous oobe flow, or might start a new check with the server. | |
| 761 GetAutoEnrollmentController()->Start(); | |
| 762 | |
| 763 // Initiate mobile config load. | 746 // Initiate mobile config load. |
| 764 MobileConfig::GetInstance(); | 747 MobileConfig::GetInstance(); |
| 765 | 748 |
| 766 // Initiate device policy fetching. | 749 // Initiate device policy fetching. |
| 767 policy::BrowserPolicyConnectorChromeOS* connector = | 750 policy::BrowserPolicyConnectorChromeOS* connector = |
| 768 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 751 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 769 connector->ScheduleServiceInitialization( | 752 connector->ScheduleServiceInitialization( |
| 770 kPolicyServiceInitializationDelayMilliseconds); | 753 kPolicyServiceInitializationDelayMilliseconds); |
| 771 | 754 |
| 772 CHECK(webui_login_display_); | 755 CHECK(webui_login_display_); |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 // Chrome locale. Otherwise it will be lost if Chrome restarts. | 1413 // Chrome locale. Otherwise it will be lost if Chrome restarts. |
| 1431 // Don't need to schedule pref save because setting initial local | 1414 // Don't need to schedule pref save because setting initial local |
| 1432 // will enforce preference saving. | 1415 // will enforce preference saving. |
| 1433 prefs->SetString(prefs::kApplicationLocale, locale); | 1416 prefs->SetString(prefs::kApplicationLocale, locale); |
| 1434 StartupUtils::SetInitialLocale(locale); | 1417 StartupUtils::SetInitialLocale(locale); |
| 1435 | 1418 |
| 1436 TriggerShowLoginWizardFinish(locale, std::move(data)); | 1419 TriggerShowLoginWizardFinish(locale, std::move(data)); |
| 1437 } | 1420 } |
| 1438 | 1421 |
| 1439 } // namespace chromeos | 1422 } // namespace chromeos |
| OLD | NEW |