Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 2947483002: Create OOBE screen for Waiting for Container ready (Closed)
Patch Set: Rebase and run js format Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "chrome/browser/chromeos/login/screens/hid_detection_view.h" 48 #include "chrome/browser/chromeos/login/screens/hid_detection_view.h"
49 #include "chrome/browser/chromeos/login/screens/kiosk_autolaunch_screen.h" 49 #include "chrome/browser/chromeos/login/screens/kiosk_autolaunch_screen.h"
50 #include "chrome/browser/chromeos/login/screens/kiosk_enable_screen.h" 50 #include "chrome/browser/chromeos/login/screens/kiosk_enable_screen.h"
51 #include "chrome/browser/chromeos/login/screens/network_error.h" 51 #include "chrome/browser/chromeos/login/screens/network_error.h"
52 #include "chrome/browser/chromeos/login/screens/network_view.h" 52 #include "chrome/browser/chromeos/login/screens/network_view.h"
53 #include "chrome/browser/chromeos/login/screens/reset_screen.h" 53 #include "chrome/browser/chromeos/login/screens/reset_screen.h"
54 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h" 54 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h"
55 #include "chrome/browser/chromeos/login/screens/update_screen.h" 55 #include "chrome/browser/chromeos/login/screens/update_screen.h"
56 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" 56 #include "chrome/browser/chromeos/login/screens/user_image_screen.h"
57 #include "chrome/browser/chromeos/login/screens/voice_interaction_value_prop_scr een.h" 57 #include "chrome/browser/chromeos/login/screens/voice_interaction_value_prop_scr een.h"
58 #include "chrome/browser/chromeos/login/screens/wait_for_container_ready_screen. h"
58 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" 59 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h"
59 #include "chrome/browser/chromeos/login/session/user_session_manager.h" 60 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
60 #include "chrome/browser/chromeos/login/startup_utils.h" 61 #include "chrome/browser/chromeos/login/startup_utils.h"
61 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre en.h" 62 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre en.h"
62 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 63 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
63 #include "chrome/browser/chromeos/net/delay_network_call.h" 64 #include "chrome/browser/chromeos/net/delay_network_call.h"
64 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 65 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
65 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" 66 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
66 #include "chrome/browser/chromeos/settings/cros_settings.h" 67 #include "chrome/browser/chromeos/settings/cros_settings.h"
67 #include "chrome/browser/chromeos/system/device_disabling_manager.h" 68 #include "chrome/browser/chromeos/system/device_disabling_manager.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 remora_controller_.get()); 430 remora_controller_.get());
430 } else if (screen == OobeScreen::SCREEN_DEVICE_DISABLED) { 431 } else if (screen == OobeScreen::SCREEN_DEVICE_DISABLED) {
431 return new DeviceDisabledScreen(this, 432 return new DeviceDisabledScreen(this,
432 oobe_ui_->GetDeviceDisabledScreenView()); 433 oobe_ui_->GetDeviceDisabledScreenView());
433 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) { 434 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) {
434 return new EncryptionMigrationScreen( 435 return new EncryptionMigrationScreen(
435 this, oobe_ui_->GetEncryptionMigrationScreenView()); 436 this, oobe_ui_->GetEncryptionMigrationScreenView());
436 } else if (screen == OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP) { 437 } else if (screen == OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP) {
437 return new VoiceInteractionValuePropScreen( 438 return new VoiceInteractionValuePropScreen(
438 this, oobe_ui_->GetVoiceInteractionValuePropScreenView()); 439 this, oobe_ui_->GetVoiceInteractionValuePropScreenView());
440 } else if (screen == OobeScreen::SCREEN_WAIT_FOR_CONTAINER_READY) {
441 return new WaitForContainerReadyScreen(
442 this, oobe_ui_->GetWaitForContainerReadyScreenView());
439 } 443 }
440 444
441 return nullptr; 445 return nullptr;
442 } 446 }
443 447
444 void WizardController::ShowNetworkScreen() { 448 void WizardController::ShowNetworkScreen() {
445 VLOG(1) << "Showing network screen."; 449 VLOG(1) << "Showing network screen.";
446 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_NETWORK); 450 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_NETWORK);
447 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_NETWORK)); 451 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_NETWORK));
448 452
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 VLOG(1) << "Showing voice interaction value prop screen."; 641 VLOG(1) << "Showing voice interaction value prop screen.";
638 UpdateStatusAreaVisibilityForScreen( 642 UpdateStatusAreaVisibilityForScreen(
639 OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP); 643 OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP);
640 SetCurrentScreen( 644 SetCurrentScreen(
641 GetScreen(OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP)); 645 GetScreen(OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP));
642 } else { 646 } else {
643 OnOobeFlowFinished(); 647 OnOobeFlowFinished();
644 } 648 }
645 } 649 }
646 650
651 void WizardController::ShowWaitForContainerReadyScreen() {
652 UpdateStatusAreaVisibilityForScreen(
653 OobeScreen::SCREEN_WAIT_FOR_CONTAINER_READY);
654 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_WAIT_FOR_CONTAINER_READY));
655 }
656
647 void WizardController::SkipToLoginForTesting( 657 void WizardController::SkipToLoginForTesting(
648 const LoginScreenContext& context) { 658 const LoginScreenContext& context) {
649 VLOG(1) << "SkipToLoginForTesting."; 659 VLOG(1) << "SkipToLoginForTesting.";
650 StartupUtils::MarkEulaAccepted(); 660 StartupUtils::MarkEulaAccepted();
651 PerformPostEulaActions(); 661 PerformPostEulaActions();
652 OnDeviceDisabledChecked(false /* device_disabled */); 662 OnDeviceDisabledChecked(false /* device_disabled */);
653 } 663 }
654 664
655 pairing_chromeos::SharkConnectionListener* 665 pairing_chromeos::SharkConnectionListener*
656 WizardController::GetSharkConnectionListenerForTesting() { 666 WizardController::GetSharkConnectionListenerForTesting() {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 void WizardController::OnVoiceInteractionValuePropSkipped() { 858 void WizardController::OnVoiceInteractionValuePropSkipped() {
849 OnOobeFlowFinished(); 859 OnOobeFlowFinished();
850 } 860 }
851 861
852 void WizardController::OnVoiceInteractionValuePropAccepted() { 862 void WizardController::OnVoiceInteractionValuePropAccepted() {
853 const Profile* profile = ProfileManager::GetActiveUserProfile(); 863 const Profile* profile = ProfileManager::GetActiveUserProfile();
854 if (is_in_session_oobe_ && !arc::IsArcPlayStoreEnabledForProfile(profile)) { 864 if (is_in_session_oobe_ && !arc::IsArcPlayStoreEnabledForProfile(profile)) {
855 ShowArcTermsOfServiceScreen(); 865 ShowArcTermsOfServiceScreen();
856 return; 866 return;
857 } 867 }
868 ShowWaitForContainerReadyScreen();
869 }
870
871 void WizardController::OnWaitForContainerReadyFinished() {
872 OnOobeFlowFinished();
858 StartVoiceInteractionSetupWizard(); 873 StartVoiceInteractionSetupWizard();
859 OnOobeFlowFinished();
860 } 874 }
861 875
862 void WizardController::OnControllerPairingFinished() { 876 void WizardController::OnControllerPairingFinished() {
863 ShowAutoEnrollmentCheckScreen(); 877 ShowAutoEnrollmentCheckScreen();
864 } 878 }
865 879
866 void WizardController::OnAutoEnrollmentCheckCompleted() { 880 void WizardController::OnAutoEnrollmentCheckCompleted() {
867 // Check whether the device is disabled. OnDeviceDisabledChecked() will be 881 // Check whether the device is disabled. OnDeviceDisabledChecked() will be
868 // invoked when the result of this check is known. Until then, the current 882 // invoked when the result of this check is known. Until then, the current
869 // screen will remain visible and will continue showing a spinner. 883 // screen will remain visible and will continue showing a spinner.
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 } else if (screen == OobeScreen::SCREEN_OOBE_CONTROLLER_PAIRING) { 1131 } else if (screen == OobeScreen::SCREEN_OOBE_CONTROLLER_PAIRING) {
1118 ShowControllerPairingScreen(); 1132 ShowControllerPairingScreen();
1119 } else if (screen == OobeScreen::SCREEN_OOBE_HOST_PAIRING) { 1133 } else if (screen == OobeScreen::SCREEN_OOBE_HOST_PAIRING) {
1120 ShowHostPairingScreen(); 1134 ShowHostPairingScreen();
1121 } else if (screen == OobeScreen::SCREEN_DEVICE_DISABLED) { 1135 } else if (screen == OobeScreen::SCREEN_DEVICE_DISABLED) {
1122 ShowDeviceDisabledScreen(); 1136 ShowDeviceDisabledScreen();
1123 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) { 1137 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) {
1124 ShowEncryptionMigrationScreen(); 1138 ShowEncryptionMigrationScreen();
1125 } else if (screen == OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP) { 1139 } else if (screen == OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP) {
1126 ShowVoiceInteractionValuePropScreen(); 1140 ShowVoiceInteractionValuePropScreen();
1141 } else if (screen == OobeScreen::SCREEN_WAIT_FOR_CONTAINER_READY) {
1142 ShowWaitForContainerReadyScreen();
1127 } else if (screen != OobeScreen::SCREEN_TEST_NO_WINDOW) { 1143 } else if (screen != OobeScreen::SCREEN_TEST_NO_WINDOW) {
1128 if (is_out_of_box_) { 1144 if (is_out_of_box_) {
1129 time_oobe_started_ = base::Time::Now(); 1145 time_oobe_started_ = base::Time::Now();
1130 if (IsRemoraPairingOobe() || IsControllerDetected()) { 1146 if (IsRemoraPairingOobe() || IsControllerDetected()) {
1131 ShowHostPairingScreen(); 1147 ShowHostPairingScreen();
1132 } else if (CanShowHIDDetectionScreen()) { 1148 } else if (CanShowHIDDetectionScreen()) {
1133 hid_screen_ = GetScreen(OobeScreen::SCREEN_OOBE_HID_DETECTION); 1149 hid_screen_ = GetScreen(OobeScreen::SCREEN_OOBE_HID_DETECTION);
1134 base::Callback<void(bool)> on_check = base::Bind( 1150 base::Callback<void(bool)> on_check = base::Bind(
1135 &WizardController::OnHIDScreenNecessityCheck, 1151 &WizardController::OnHIDScreenNecessityCheck,
1136 weak_factory_.GetWeakPtr()); 1152 weak_factory_.GetWeakPtr());
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 break; 1247 break;
1232 case ScreenExitCode::CONTROLLER_PAIRING_FINISHED: 1248 case ScreenExitCode::CONTROLLER_PAIRING_FINISHED:
1233 OnControllerPairingFinished(); 1249 OnControllerPairingFinished();
1234 break; 1250 break;
1235 case ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_SKIPPED: 1251 case ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_SKIPPED:
1236 OnVoiceInteractionValuePropSkipped(); 1252 OnVoiceInteractionValuePropSkipped();
1237 break; 1253 break;
1238 case ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_ACCEPTED: 1254 case ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_ACCEPTED:
1239 OnVoiceInteractionValuePropAccepted(); 1255 OnVoiceInteractionValuePropAccepted();
1240 break; 1256 break;
1257 case ScreenExitCode::WAIT_FOR_CONTAINER_READY_FINISHED:
1258 OnWaitForContainerReadyFinished();
1259 break;
1241 default: 1260 default:
1242 NOTREACHED(); 1261 NOTREACHED();
1243 } 1262 }
1244 } 1263 }
1245 1264
1246 void WizardController::ShowErrorScreen() { 1265 void WizardController::ShowErrorScreen() {
1247 VLOG(1) << "Showing error screen."; 1266 VLOG(1) << "Showing error screen.";
1248 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ERROR_MESSAGE)); 1267 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ERROR_MESSAGE));
1249 } 1268 }
1250 1269
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 SetCurrentScreen(screen); 1682 SetCurrentScreen(screen);
1664 } 1683 }
1665 1684
1666 AutoEnrollmentController* WizardController::GetAutoEnrollmentController() { 1685 AutoEnrollmentController* WizardController::GetAutoEnrollmentController() {
1667 if (!auto_enrollment_controller_) 1686 if (!auto_enrollment_controller_)
1668 auto_enrollment_controller_ = base::MakeUnique<AutoEnrollmentController>(); 1687 auto_enrollment_controller_ = base::MakeUnique<AutoEnrollmentController>();
1669 return auto_enrollment_controller_.get(); 1688 return auto_enrollment_controller_.get();
1670 } 1689 }
1671 1690
1672 } // namespace chromeos 1691 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | chrome/browser/chromeos/login/wizard_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698