| Index: chrome/browser/chromeos/login/wizard_controller.cc
|
| diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
|
| index 4e9380752441fca91696f6e2065b99b6a775d4b0..84f24035fd4e80d41214c11aef70cf7e9cc53d1c 100644
|
| --- a/chrome/browser/chromeos/login/wizard_controller.cc
|
| +++ b/chrome/browser/chromeos/login/wizard_controller.cc
|
| @@ -33,6 +33,7 @@
|
| #include "chrome/browser/chromeos/login/hwid_checker.h"
|
| #include "chrome/browser/chromeos/login/login_utils.h"
|
| #include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.h"
|
| +#include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h"
|
| #include "chrome/browser/chromeos/login/screens/error_screen.h"
|
| #include "chrome/browser/chromeos/login/screens/eula_screen.h"
|
| #include "chrome/browser/chromeos/login/screens/hid_detection_screen.h"
|
| @@ -102,6 +103,11 @@ bool CanShowHIDDetectionScreen() {
|
| chromeos::switches::kEnableHIDDetectionOnOOBE);
|
| }
|
|
|
| +bool ShouldShowControllerPairingScreen() {
|
| + return CommandLine::ForCurrentProcess()->HasSwitch(
|
| + chromeos::switches::kShowControllerPairingDemo);
|
| +}
|
| +
|
| bool IsResumableScreen(const std::string& screen) {
|
| for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kResumableScreens); ++i) {
|
| if (screen == kResumableScreens[i])
|
| @@ -133,6 +139,8 @@ const char WizardController::kLocallyManagedUserCreationScreenName[] =
|
| const char WizardController::kAppLaunchSplashScreenName[] =
|
| "app-launch-splash";
|
| const char WizardController::kHIDDetectionScreenName[] = "hid-detection";
|
| +const char WizardController::kControllerPairingScreenName[] =
|
| + "controller-pairing";
|
|
|
| // static
|
| const int WizardController::kMinAudibleOutputVolumePercent = 10;
|
| @@ -358,6 +366,14 @@ chromeos::HIDDetectionScreen* WizardController::GetHIDDetectionScreen() {
|
| return hid_detection_screen_.get();
|
| }
|
|
|
| +ControllerPairingScreen* WizardController::GetControllerPairingScreen() {
|
| + if (!controller_pairing_screen_) {
|
| + controller_pairing_screen_.reset(new ControllerPairingScreen(
|
| + this, oobe_display_->GetControllerPairingScreenActor()));
|
| + }
|
| + return controller_pairing_screen_.get();
|
| +}
|
| +
|
| void WizardController::ShowNetworkScreen() {
|
| VLOG(1) << "Showing network screen.";
|
| // Hide the status area initially; it only appears after OOBE first animates
|
| @@ -516,6 +532,12 @@ void WizardController::ShowHIDDetectionScreen() {
|
| SetCurrentScreen(GetHIDDetectionScreen());
|
| }
|
|
|
| +void WizardController::ShowControllerPairingScreen() {
|
| + VLOG(1) << "Showing controller pairing screen.";
|
| + SetStatusAreaVisible(false);
|
| + SetCurrentScreen(GetControllerPairingScreen());
|
| +}
|
| +
|
| void WizardController::SkipToLoginForTesting(
|
| const LoginScreenContext& context) {
|
| VLOG(1) << "SkipToLoginForTesting.";
|
| @@ -570,7 +592,11 @@ void WizardController::OnConnectionFailed() {
|
| }
|
|
|
| void WizardController::OnUpdateCompleted() {
|
| - ShowAutoEnrollmentCheckScreen();
|
| + if (ShouldShowControllerPairingScreen()) {
|
| + ShowControllerPairingScreen();
|
| + } else {
|
| + ShowAutoEnrollmentCheckScreen();
|
| + }
|
| }
|
|
|
| void WizardController::OnEulaAccepted() {
|
| @@ -703,6 +729,10 @@ void WizardController::OnTermsOfServiceAccepted() {
|
| ShowUserImageScreen();
|
| }
|
|
|
| +void WizardController::OnControllerPairingFinished() {
|
| + ShowAutoEnrollmentCheckScreen();
|
| +}
|
| +
|
| void WizardController::InitiateOOBEUpdate() {
|
| PerformPostEulaActions();
|
| SetCurrentScreenSmooth(GetUpdateScreen(), true);
|
| @@ -764,7 +794,7 @@ void WizardController::ShowCurrentScreen() {
|
|
|
| FOR_EACH_OBSERVER(Observer, observer_list_, OnScreenChanged(current_screen_));
|
|
|
| - oobe_display_->ShowScreen(current_screen_);
|
| + current_screen_->Show();
|
| }
|
|
|
| void WizardController::SetCurrentScreenSmooth(WizardScreen* new_current,
|
| @@ -778,7 +808,7 @@ void WizardController::SetCurrentScreenSmooth(WizardScreen* new_current,
|
| smooth_show_timer_.Stop();
|
|
|
| if (current_screen_)
|
| - oobe_display_->HideScreen(current_screen_);
|
| + current_screen_->Hide();
|
|
|
| previous_screen_ = current_screen_;
|
| current_screen_ = new_current;
|
| @@ -829,6 +859,8 @@ void WizardController::AdvanceToScreen(const std::string& screen_name) {
|
| AutoLaunchKioskApp();
|
| } else if (screen_name == kHIDDetectionScreenName) {
|
| ShowHIDDetectionScreen();
|
| + } else if (screen_name == kControllerPairingScreenName) {
|
| + ShowControllerPairingScreen();
|
| } else if (screen_name != kTestNoScreenName) {
|
| if (is_out_of_box_) {
|
| if (CanShowHIDDetectionScreen())
|
| @@ -907,6 +939,9 @@ void WizardController::OnExit(ExitCodes exit_code) {
|
| case WRONG_HWID_WARNING_SKIPPED:
|
| OnWrongHWIDWarningSkipped();
|
| break;
|
| + case CONTROLLER_PAIRING_FINISHED:
|
| + OnControllerPairingFinished();
|
| + break;
|
| default:
|
| NOTREACHED();
|
| }
|
|
|