| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class LoginDisplayHost; | 44 class LoginDisplayHost; |
| 45 class LoginScreenContext; | 45 class LoginScreenContext; |
| 46 class OobeUI; | 46 class OobeUI; |
| 47 class SimpleGeolocationProvider; | 47 class SimpleGeolocationProvider; |
| 48 class TimeZoneProvider; | 48 class TimeZoneProvider; |
| 49 struct TimeZoneResponseData; | 49 struct TimeZoneResponseData; |
| 50 | 50 |
| 51 // Class that manages control flow between wizard screens. Wizard controller | 51 // Class that manages control flow between wizard screens. Wizard controller |
| 52 // interacts with screen controllers to move the user between screens. | 52 // interacts with screen controllers to move the user between screens. |
| 53 class WizardController : public BaseScreenDelegate, | 53 class WizardController : public BaseScreenDelegate, |
| 54 public ScreenManager, | |
| 55 public EulaScreen::Delegate, | 54 public EulaScreen::Delegate, |
| 56 public ControllerPairingScreen::Delegate, | 55 public ControllerPairingScreen::Delegate, |
| 57 public HostPairingScreen::Delegate, | 56 public HostPairingScreen::Delegate, |
| 58 public NetworkScreen::Delegate, | 57 public NetworkScreen::Delegate, |
| 59 public HIDDetectionScreen::Delegate { | 58 public HIDDetectionScreen::Delegate { |
| 60 public: | 59 public: |
| 61 WizardController(LoginDisplayHost* host, OobeUI* oobe_ui); | 60 WizardController(LoginDisplayHost* host, OobeUI* oobe_ui); |
| 62 ~WizardController() override; | 61 ~WizardController() override; |
| 63 | 62 |
| 64 // Returns the default wizard controller if it has been created. | 63 // Returns the default wizard controller if it has been created. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // reworked at hackaton. | 105 // reworked at hackaton. |
| 107 void EnableUserImageScreenReturnToPreviousHack(); | 106 void EnableUserImageScreenReturnToPreviousHack(); |
| 108 | 107 |
| 109 // Returns a pointer to the current screen or nullptr if there's no such | 108 // Returns a pointer to the current screen or nullptr if there's no such |
| 110 // screen. | 109 // screen. |
| 111 BaseScreen* current_screen() const { return current_screen_; } | 110 BaseScreen* current_screen() const { return current_screen_; } |
| 112 | 111 |
| 113 // Returns true if the current wizard instance has reached the login screen. | 112 // Returns true if the current wizard instance has reached the login screen. |
| 114 bool login_screen_started() const { return login_screen_started_; } | 113 bool login_screen_started() const { return login_screen_started_; } |
| 115 | 114 |
| 116 // ScreenManager implementation. | 115 // Returns a given screen. Creates it lazily. |
| 117 BaseScreen* GetScreen(OobeScreen screen) override; | 116 BaseScreen* GetScreen(OobeScreen screen); |
| 118 BaseScreen* CreateScreen(OobeScreen screen) override; | 117 |
| 118 // Returns the current ScreenManager instance. |
| 119 ScreenManager* screen_manager() { return &screen_manager_; } |
| 119 | 120 |
| 120 // Volume percent at which spoken feedback is still audible. | 121 // Volume percent at which spoken feedback is still audible. |
| 121 static const int kMinAudibleOutputVolumePercent; | 122 static const int kMinAudibleOutputVolumePercent; |
| 122 | 123 |
| 124 // Allocate a given BaseScreen for the given |Screen|. Used by |
| 125 // |screen_manager_|. |
| 126 BaseScreen* CreateScreen(OobeScreen screen); |
| 127 |
| 123 private: | 128 private: |
| 124 // Show specific screen. | 129 // Show specific screen. |
| 125 void ShowNetworkScreen(); | 130 void ShowNetworkScreen(); |
| 126 void ShowUpdateScreen(); | 131 void ShowUpdateScreen(); |
| 127 void ShowUserImageScreen(); | 132 void ShowUserImageScreen(); |
| 128 void ShowEulaScreen(); | 133 void ShowEulaScreen(); |
| 129 void ShowEnrollmentScreen(); | 134 void ShowEnrollmentScreen(); |
| 130 void ShowResetScreen(); | 135 void ShowResetScreen(); |
| 131 void ShowKioskAutolaunchScreen(); | 136 void ShowKioskAutolaunchScreen(); |
| 132 void ShowEnableDebuggingScreen(); | 137 void ShowEnableDebuggingScreen(); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 void OnSetHostNetworkSuccessful(); | 298 void OnSetHostNetworkSuccessful(); |
| 294 void OnSetHostNetworkFailed(); | 299 void OnSetHostNetworkFailed(); |
| 295 | 300 |
| 296 // Start the enrollment screen using the config from | 301 // Start the enrollment screen using the config from |
| 297 // |prescribed_enrollment_config_|. If |force_interactive| is true, | 302 // |prescribed_enrollment_config_|. If |force_interactive| is true, |
| 298 // the user will be presented with a manual enrollment screen requiring | 303 // the user will be presented with a manual enrollment screen requiring |
| 299 // Gaia credentials. If it is false, the screen may return after trying | 304 // Gaia credentials. If it is false, the screen may return after trying |
| 300 // attestation-based enrollment if appropriate. | 305 // attestation-based enrollment if appropriate. |
| 301 void StartEnrollmentScreen(bool force_interactive); | 306 void StartEnrollmentScreen(bool force_interactive); |
| 302 | 307 |
| 308 ScreenManager screen_manager_; |
| 309 |
| 303 // Whether to skip any screens that may normally be shown after login | 310 // Whether to skip any screens that may normally be shown after login |
| 304 // (registration, Terms of Service, user image selection). | 311 // (registration, Terms of Service, user image selection). |
| 305 static bool skip_post_login_screens_; | 312 static bool skip_post_login_screens_; |
| 306 | 313 |
| 307 static bool zero_delay_enabled_; | 314 static bool zero_delay_enabled_; |
| 308 | 315 |
| 309 // Screen that's currently active. | 316 // Screen that's currently active. |
| 310 BaseScreen* current_screen_ = nullptr; | 317 BaseScreen* current_screen_ = nullptr; |
| 311 | 318 |
| 312 // Screen that was active before, or nullptr for login screen. | 319 // Screen that was active before, or nullptr for login screen. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 BaseScreen* hid_screen_ = nullptr; | 412 BaseScreen* hid_screen_ = nullptr; |
| 406 | 413 |
| 407 base::WeakPtrFactory<WizardController> weak_factory_; | 414 base::WeakPtrFactory<WizardController> weak_factory_; |
| 408 | 415 |
| 409 DISALLOW_COPY_AND_ASSIGN(WizardController); | 416 DISALLOW_COPY_AND_ASSIGN(WizardController); |
| 410 }; | 417 }; |
| 411 | 418 |
| 412 } // namespace chromeos | 419 } // namespace chromeos |
| 413 | 420 |
| 414 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 421 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| OLD | NEW |