| 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 <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 class UserImageScreen; | 53 class UserImageScreen; |
| 54 | 54 |
| 55 // Class that manages control flow between wizard screens. Wizard controller | 55 // Class that manages control flow between wizard screens. Wizard controller |
| 56 // interacts with screen controllers to move the user between screens. | 56 // interacts with screen controllers to move the user between screens. |
| 57 class WizardController : public ScreenObserver, public ScreenManager { | 57 class WizardController : public ScreenObserver, public ScreenManager { |
| 58 public: | 58 public: |
| 59 // Observes screen changes. | 59 // Observes screen changes. |
| 60 class Observer { | 60 class Observer { |
| 61 public: | 61 public: |
| 62 // Called before a screen change happens. | 62 // Called before a screen change happens. |
| 63 virtual void OnScreenChanged(WizardScreen* next_screen) = 0; | 63 virtual void OnScreenChanged(BaseScreen* next_screen) = 0; |
| 64 | 64 |
| 65 // Called after the browser session has started. | 65 // Called after the browser session has started. |
| 66 virtual void OnSessionStart() = 0; | 66 virtual void OnSessionStart() = 0; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 WizardController(LoginDisplayHost* host, OobeDisplay* oobe_display); | 69 WizardController(LoginDisplayHost* host, OobeDisplay* oobe_display); |
| 70 virtual ~WizardController(); | 70 virtual ~WizardController(); |
| 71 | 71 |
| 72 // Returns the default wizard controller if it has been created. | 72 // Returns the default wizard controller if it has been created. |
| 73 static WizardController* default_controller() { | 73 static WizardController* default_controller() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 // Skip update, go straight to enrollment after EULA is accepted. | 124 // Skip update, go straight to enrollment after EULA is accepted. |
| 125 void SkipUpdateEnrollAfterEula(); | 125 void SkipUpdateEnrollAfterEula(); |
| 126 | 126 |
| 127 // TODO(antrim) : temporary hack. Should be removed once screen system is | 127 // TODO(antrim) : temporary hack. Should be removed once screen system is |
| 128 // reworked at hackaton. | 128 // reworked at hackaton. |
| 129 void EnableUserImageScreenReturnToPreviousHack(); | 129 void EnableUserImageScreenReturnToPreviousHack(); |
| 130 | 130 |
| 131 // Returns a pointer to the current screen or NULL if there's no such | 131 // Returns a pointer to the current screen or NULL if there's no such |
| 132 // screen. | 132 // screen. |
| 133 WizardScreen* current_screen() const { return current_screen_; } | 133 BaseScreen* current_screen() const { return current_screen_; } |
| 134 | 134 |
| 135 // Returns true if the current wizard instance has reached the login screen. | 135 // Returns true if the current wizard instance has reached the login screen. |
| 136 bool login_screen_started() const { return login_screen_started_; } | 136 bool login_screen_started() const { return login_screen_started_; } |
| 137 | 137 |
| 138 // ScreenManager implementation. | 138 // ScreenManager implementation. |
| 139 virtual WizardScreen* CreateScreen(const std::string& screen_name) override; | 139 virtual BaseScreen* CreateScreen(const std::string& screen_name) override; |
| 140 | 140 |
| 141 static const char kNetworkScreenName[]; | 141 static const char kNetworkScreenName[]; |
| 142 static const char kLoginScreenName[]; | 142 static const char kLoginScreenName[]; |
| 143 static const char kUpdateScreenName[]; | 143 static const char kUpdateScreenName[]; |
| 144 static const char kUserImageScreenName[]; | 144 static const char kUserImageScreenName[]; |
| 145 static const char kOutOfBoxScreenName[]; | 145 static const char kOutOfBoxScreenName[]; |
| 146 static const char kTestNoScreenName[]; | 146 static const char kTestNoScreenName[]; |
| 147 static const char kEulaScreenName[]; | 147 static const char kEulaScreenName[]; |
| 148 static const char kEnrollmentScreenName[]; | 148 static const char kEnrollmentScreenName[]; |
| 149 static const char kResetScreenName[]; | 149 static const char kResetScreenName[]; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 // Overridden from ScreenObserver: | 235 // Overridden from ScreenObserver: |
| 236 virtual void OnExit(ExitCodes exit_code) override; | 236 virtual void OnExit(ExitCodes exit_code) override; |
| 237 virtual void ShowCurrentScreen() override; | 237 virtual void ShowCurrentScreen() override; |
| 238 virtual void OnSetUserNamePassword(const std::string& username, | 238 virtual void OnSetUserNamePassword(const std::string& username, |
| 239 const std::string& password) override; | 239 const std::string& password) override; |
| 240 virtual void SetUsageStatisticsReporting(bool val) override; | 240 virtual void SetUsageStatisticsReporting(bool val) override; |
| 241 virtual bool GetUsageStatisticsReporting() const override; | 241 virtual bool GetUsageStatisticsReporting() const override; |
| 242 virtual ErrorScreen* GetErrorScreen() override; | 242 virtual ErrorScreen* GetErrorScreen() override; |
| 243 virtual void ShowErrorScreen() override; | 243 virtual void ShowErrorScreen() override; |
| 244 virtual void HideErrorScreen(WizardScreen* parent_screen) override; | 244 virtual void HideErrorScreen(BaseScreen* parent_screen) override; |
| 245 | 245 |
| 246 // Notification of a change in the state of an accessibility setting. | 246 // Notification of a change in the state of an accessibility setting. |
| 247 void OnAccessibilityStatusChanged( | 247 void OnAccessibilityStatusChanged( |
| 248 const AccessibilityStatusEventDetails& details); | 248 const AccessibilityStatusEventDetails& details); |
| 249 | 249 |
| 250 // Switches from one screen to another. | 250 // Switches from one screen to another. |
| 251 void SetCurrentScreen(WizardScreen* screen); | 251 void SetCurrentScreen(BaseScreen* screen); |
| 252 | 252 |
| 253 // Switches from one screen to another with delay before showing. Calling | 253 // Switches from one screen to another with delay before showing. Calling |
| 254 // ShowCurrentScreen directly forces screen to be shown immediately. | 254 // ShowCurrentScreen directly forces screen to be shown immediately. |
| 255 void SetCurrentScreenSmooth(WizardScreen* screen, bool use_smoothing); | 255 void SetCurrentScreenSmooth(BaseScreen* screen, bool use_smoothing); |
| 256 | 256 |
| 257 // Changes status area visibility. | 257 // Changes status area visibility. |
| 258 void SetStatusAreaVisible(bool visible); | 258 void SetStatusAreaVisible(bool visible); |
| 259 | 259 |
| 260 // Logs in the specified user via default login screen. | 260 // Logs in the specified user via default login screen. |
| 261 void Login(const std::string& username, const std::string& password); | 261 void Login(const std::string& username, const std::string& password); |
| 262 | 262 |
| 263 // Launched kiosk app configured for auto-launch. | 263 // Launched kiosk app configured for auto-launch. |
| 264 void AutoLaunchKioskApp(); | 264 void AutoLaunchKioskApp(); |
| 265 | 265 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 void OnSharkConnected( | 312 void OnSharkConnected( |
| 313 scoped_ptr<pairing_chromeos::HostPairingController> pairing_controller); | 313 scoped_ptr<pairing_chromeos::HostPairingController> pairing_controller); |
| 314 | 314 |
| 315 // Whether to skip any screens that may normally be shown after login | 315 // Whether to skip any screens that may normally be shown after login |
| 316 // (registration, Terms of Service, user image selection). | 316 // (registration, Terms of Service, user image selection). |
| 317 static bool skip_post_login_screens_; | 317 static bool skip_post_login_screens_; |
| 318 | 318 |
| 319 static bool zero_delay_enabled_; | 319 static bool zero_delay_enabled_; |
| 320 | 320 |
| 321 // Screen that's currently active. | 321 // Screen that's currently active. |
| 322 WizardScreen* current_screen_; | 322 BaseScreen* current_screen_; |
| 323 | 323 |
| 324 // Screen that was active before, or NULL for login screen. | 324 // Screen that was active before, or NULL for login screen. |
| 325 WizardScreen* previous_screen_; | 325 BaseScreen* previous_screen_; |
| 326 | 326 |
| 327 std::string username_; | 327 std::string username_; |
| 328 std::string password_; | 328 std::string password_; |
| 329 | 329 |
| 330 // True if running official BUILD. | 330 // True if running official BUILD. |
| 331 bool is_official_build_; | 331 bool is_official_build_; |
| 332 | 332 |
| 333 // True if full OOBE flow should be shown. | 333 // True if full OOBE flow should be shown. |
| 334 bool is_out_of_box_; | 334 bool is_out_of_box_; |
| 335 | 335 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 shark_connection_listener_; | 415 shark_connection_listener_; |
| 416 | 416 |
| 417 base::WeakPtrFactory<WizardController> weak_factory_; | 417 base::WeakPtrFactory<WizardController> weak_factory_; |
| 418 | 418 |
| 419 DISALLOW_COPY_AND_ASSIGN(WizardController); | 419 DISALLOW_COPY_AND_ASSIGN(WizardController); |
| 420 }; | 420 }; |
| 421 | 421 |
| 422 } // namespace chromeos | 422 } // namespace chromeos |
| 423 | 423 |
| 424 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 424 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| OLD | NEW |