Chromium Code Reviews| 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/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 #include "base/threading/sequenced_worker_pool.h" | 24 #include "base/threading/sequenced_worker_pool.h" |
| 25 #include "base/threading/thread_task_runner_handle.h" | 25 #include "base/threading/thread_task_runner_handle.h" |
| 26 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
| 27 #include "chrome/browser/browser_process_platform_part.h" | 27 #include "chrome/browser/browser_process_platform_part.h" |
| 28 #include "chrome/browser/chrome_notification_types.h" | 28 #include "chrome/browser/chrome_notification_types.h" |
| 29 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 29 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 30 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 30 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 31 #include "chrome/browser/chromeos/arc/arc_util.h" | 31 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 32 #include "chrome/browser/chromeos/customization/customization_document.h" | 32 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 33 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen. h" | 33 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen. h" |
| 34 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" | |
| 34 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" | 35 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" |
| 35 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 36 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 36 #include "chrome/browser/chromeos/login/helper.h" | 37 #include "chrome/browser/chromeos/login/helper.h" |
| 37 #include "chrome/browser/chromeos/login/hwid_checker.h" | 38 #include "chrome/browser/chromeos/login/hwid_checker.h" |
| 38 #include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h" | 39 #include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h" |
| 39 #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h" | 40 #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h" |
| 40 #include "chrome/browser/chromeos/login/screens/enable_debugging_screen.h" | 41 #include "chrome/browser/chromeos/login/screens/enable_debugging_screen.h" |
| 41 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 42 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
| 42 #include "chrome/browser/chromeos/login/screens/eula_screen.h" | 43 #include "chrome/browser/chromeos/login/screens/eula_screen.h" |
| 43 #include "chrome/browser/chromeos/login/screens/hid_detection_view.h" | 44 #include "chrome/browser/chromeos/login/screens/hid_detection_view.h" |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_WRONG_HWID)); | 585 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_WRONG_HWID)); |
| 585 } | 586 } |
| 586 | 587 |
| 587 void WizardController::ShowAutoEnrollmentCheckScreen() { | 588 void WizardController::ShowAutoEnrollmentCheckScreen() { |
| 588 VLOG(1) << "Showing Auto-enrollment check screen."; | 589 VLOG(1) << "Showing Auto-enrollment check screen."; |
| 589 SetStatusAreaVisible(true); | 590 SetStatusAreaVisible(true); |
| 590 AutoEnrollmentCheckScreen* screen = | 591 AutoEnrollmentCheckScreen* screen = |
| 591 AutoEnrollmentCheckScreen::Get(screen_manager()); | 592 AutoEnrollmentCheckScreen::Get(screen_manager()); |
| 592 if (retry_auto_enrollment_check_) | 593 if (retry_auto_enrollment_check_) |
| 593 screen->ClearState(); | 594 screen->ClearState(); |
| 594 screen->set_auto_enrollment_controller(host_->GetAutoEnrollmentController()); | 595 screen->set_auto_enrollment_controller(GetAutoEnrollmentController()); |
| 595 SetCurrentScreen(screen); | 596 SetCurrentScreen(screen); |
| 596 } | 597 } |
| 597 | 598 |
| 598 void WizardController::ShowSupervisedUserCreationScreen() { | 599 void WizardController::ShowSupervisedUserCreationScreen() { |
| 599 VLOG(1) << "Showing Locally managed user creation screen screen."; | 600 VLOG(1) << "Showing Locally managed user creation screen screen."; |
| 600 SetStatusAreaVisible(true); | 601 SetStatusAreaVisible(true); |
| 601 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_CREATE_SUPERVISED_USER_FLOW)); | 602 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_CREATE_SUPERVISED_USER_FLOW)); |
| 602 } | 603 } |
| 603 | 604 |
| 604 void WizardController::ShowArcKioskSplashScreen() { | 605 void WizardController::ShowArcKioskSplashScreen() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 654 | 655 |
| 655 /////////////////////////////////////////////////////////////////////////////// | 656 /////////////////////////////////////////////////////////////////////////////// |
| 656 // WizardController, ExitHandlers: | 657 // WizardController, ExitHandlers: |
| 657 void WizardController::OnHIDDetectionCompleted() { | 658 void WizardController::OnHIDDetectionCompleted() { |
| 658 // Check for tests configuration. | 659 // Check for tests configuration. |
| 659 if (!StartupUtils::IsOobeCompleted()) | 660 if (!StartupUtils::IsOobeCompleted()) |
| 660 ShowNetworkScreen(); | 661 ShowNetworkScreen(); |
| 661 } | 662 } |
| 662 | 663 |
| 663 void WizardController::OnNetworkConnected() { | 664 void WizardController::OnNetworkConnected() { |
| 664 if (is_official_build_) { | 665 if (!StartupUtils::IsEulaAccepted()) { |
| 665 if (!StartupUtils::IsEulaAccepted()) { | 666 if (is_official_build_) { |
| 666 ShowEulaScreen(); | 667 ShowEulaScreen(); |
| 667 } else { | 668 } else { |
| 668 // Possible cases: | 669 // Follow the same flow as if EULA had been accepted. |
| 669 // 1. EULA was accepted, forced shutdown/reboot during update. | 670 OnEulaAccepted(); |
| 670 // 2. EULA was accepted, planned reboot after update. | |
| 671 // Make sure that device is up to date. | |
| 672 InitiateOOBEUpdate(); | |
| 673 } | 671 } |
| 674 } else { | 672 } else { |
| 673 // Possible cases: | |
| 674 // 1. EULA was accepted, forced shutdown/reboot during update. | |
| 675 // 2. EULA was accepted, planned reboot after update. | |
| 676 // Make sure that device is up to date. | |
| 675 InitiateOOBEUpdate(); | 677 InitiateOOBEUpdate(); |
| 676 } | 678 } |
| 677 } | 679 } |
| 678 | 680 |
| 679 void WizardController::OnNetworkOffline() { | 681 void WizardController::OnNetworkOffline() { |
| 680 // TODO(dpolukhin): if(is_out_of_box_) we cannot work offline and | 682 // TODO(dpolukhin): if(is_out_of_box_) we cannot work offline and |
| 681 // should report some error message here and stay on the same screen. | 683 // should report some error message here and stay on the same screen. |
| 682 ShowLoginScreen(LoginScreenContext()); | 684 ShowLoginScreen(LoginScreenContext()); |
| 683 } | 685 } |
| 684 | 686 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 921 weak_factory_.GetWeakPtr())); | 923 weak_factory_.GetWeakPtr())); |
| 922 DelayNetworkCall( | 924 DelayNetworkCall( |
| 923 base::TimeDelta::FromMilliseconds(kDefaultNetworkRetryDelayMS), | 925 base::TimeDelta::FromMilliseconds(kDefaultNetworkRetryDelayMS), |
| 924 ServicesCustomizationDocument::GetInstance() | 926 ServicesCustomizationDocument::GetInstance() |
| 925 ->EnsureCustomizationAppliedClosure()); | 927 ->EnsureCustomizationAppliedClosure()); |
| 926 | 928 |
| 927 // Now that EULA has been accepted (for official builds), enable portal check. | 929 // Now that EULA has been accepted (for official builds), enable portal check. |
| 928 // ChromiumOS builds would go though this code path too. | 930 // ChromiumOS builds would go though this code path too. |
| 929 NetworkHandler::Get()->network_state_handler()->SetCheckPortalList( | 931 NetworkHandler::Get()->network_state_handler()->SetCheckPortalList( |
| 930 NetworkStateHandler::kDefaultCheckPortalList); | 932 NetworkStateHandler::kDefaultCheckPortalList); |
| 931 host_->GetAutoEnrollmentController()->Start(); | 933 GetAutoEnrollmentController()->Start(); |
| 932 host_->PrewarmAuthentication(); | 934 host_->PrewarmAuthentication(); |
| 933 network_portal_detector::GetInstance()->Enable(true); | 935 network_portal_detector::GetInstance()->Enable(true); |
| 934 } | 936 } |
| 935 | 937 |
| 936 void WizardController::PerformOOBECompletedActions() { | 938 void WizardController::PerformOOBECompletedActions() { |
| 937 // Avoid marking OOBE as completed multiple times if going from login screen | 939 // Avoid marking OOBE as completed multiple times if going from login screen |
| 938 // to enrollment screen (and back). | 940 // to enrollment screen (and back). |
| 939 if (oobe_marked_completed_) { | 941 if (oobe_marked_completed_) { |
| 940 return; | 942 return; |
| 941 } | 943 } |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1511 ? policy::EnrollmentConfig::MODE_MANUAL | 1513 ? policy::EnrollmentConfig::MODE_MANUAL |
| 1512 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; | 1514 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; |
| 1513 } | 1515 } |
| 1514 | 1516 |
| 1515 EnrollmentScreen* screen = EnrollmentScreen::Get(screen_manager()); | 1517 EnrollmentScreen* screen = EnrollmentScreen::Get(screen_manager()); |
| 1516 screen->SetParameters(effective_config, shark_controller_.get()); | 1518 screen->SetParameters(effective_config, shark_controller_.get()); |
| 1517 SetStatusAreaVisible(true); | 1519 SetStatusAreaVisible(true); |
| 1518 SetCurrentScreen(screen); | 1520 SetCurrentScreen(screen); |
| 1519 } | 1521 } |
| 1520 | 1522 |
| 1523 AutoEnrollmentController* WizardController::GetAutoEnrollmentController() { | |
| 1524 if (!auto_enrollment_controller_) { | |
|
achuithb
2017/03/24 01:33:29
don't need {}
Thiemo Nagel
2017/04/12 14:30:40
Done.
| |
| 1525 auto_enrollment_controller_ = base::MakeUnique<AutoEnrollmentController>(); | |
| 1526 } | |
| 1527 return auto_enrollment_controller_.get(); | |
| 1528 } | |
| 1529 | |
| 1521 } // namespace chromeos | 1530 } // namespace chromeos |
| OLD | NEW |