| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 namespace chromeos { | 27 namespace chromeos { |
| 28 | 28 |
| 29 class EnterpriseEnrollmentScreen; | 29 class EnterpriseEnrollmentScreen; |
| 30 class EulaScreen; | 30 class EulaScreen; |
| 31 class HTMLPageScreen; | 31 class HTMLPageScreen; |
| 32 class LoginDisplayHost; | 32 class LoginDisplayHost; |
| 33 class NetworkScreen; | 33 class NetworkScreen; |
| 34 class OobeDisplay; | 34 class OobeDisplay; |
| 35 class RegistrationScreen; | 35 class RegistrationScreen; |
| 36 class ResetScreen; |
| 36 class UpdateScreen; | 37 class UpdateScreen; |
| 37 class UserImageScreen; | 38 class UserImageScreen; |
| 38 class WizardScreen; | 39 class WizardScreen; |
| 39 | 40 |
| 40 // Class that manages control flow between wizard screens. Wizard controller | 41 // Class that manages control flow between wizard screens. Wizard controller |
| 41 // interacts with screen controllers to move the user between screens. | 42 // interacts with screen controllers to move the user between screens. |
| 42 class WizardController : public ScreenObserver { | 43 class WizardController : public ScreenObserver { |
| 43 public: | 44 public: |
| 44 // Observes screen changes. | 45 // Observes screen changes. |
| 45 class Observer { | 46 class Observer { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 void SkipUpdateEnrollAfterEula(); | 129 void SkipUpdateEnrollAfterEula(); |
| 129 | 130 |
| 130 // Lazy initializers and getters for screens. | 131 // Lazy initializers and getters for screens. |
| 131 NetworkScreen* GetNetworkScreen(); | 132 NetworkScreen* GetNetworkScreen(); |
| 132 UpdateScreen* GetUpdateScreen(); | 133 UpdateScreen* GetUpdateScreen(); |
| 133 UserImageScreen* GetUserImageScreen(); | 134 UserImageScreen* GetUserImageScreen(); |
| 134 EulaScreen* GetEulaScreen(); | 135 EulaScreen* GetEulaScreen(); |
| 135 RegistrationScreen* GetRegistrationScreen(); | 136 RegistrationScreen* GetRegistrationScreen(); |
| 136 HTMLPageScreen* GetHTMLPageScreen(); | 137 HTMLPageScreen* GetHTMLPageScreen(); |
| 137 EnterpriseEnrollmentScreen* GetEnterpriseEnrollmentScreen(); | 138 EnterpriseEnrollmentScreen* GetEnterpriseEnrollmentScreen(); |
| 139 ResetScreen* GetResetScreen(); |
| 138 | 140 |
| 139 // Returns a pointer to the current screen or NULL if there's no such | 141 // Returns a pointer to the current screen or NULL if there's no such |
| 140 // screen. | 142 // screen. |
| 141 WizardScreen* current_screen() const { return current_screen_; } | 143 WizardScreen* current_screen() const { return current_screen_; } |
| 142 | 144 |
| 143 // Returns true if the current wizard instance has reached the login screen. | 145 // Returns true if the current wizard instance has reached the login screen. |
| 144 bool login_screen_started() const { return login_screen_started_; } | 146 bool login_screen_started() const { return login_screen_started_; } |
| 145 | 147 |
| 146 static const char kNetworkScreenName[]; | 148 static const char kNetworkScreenName[]; |
| 147 static const char kLoginScreenName[]; | 149 static const char kLoginScreenName[]; |
| 148 static const char kUpdateScreenName[]; | 150 static const char kUpdateScreenName[]; |
| 149 static const char kUserImageScreenName[]; | 151 static const char kUserImageScreenName[]; |
| 150 static const char kRegistrationScreenName[]; | 152 static const char kRegistrationScreenName[]; |
| 151 static const char kOutOfBoxScreenName[]; | 153 static const char kOutOfBoxScreenName[]; |
| 152 static const char kTestNoScreenName[]; | 154 static const char kTestNoScreenName[]; |
| 153 static const char kEulaScreenName[]; | 155 static const char kEulaScreenName[]; |
| 154 static const char kHTMLPageScreenName[]; | 156 static const char kHTMLPageScreenName[]; |
| 155 static const char kEnterpriseEnrollmentScreenName[]; | 157 static const char kEnterpriseEnrollmentScreenName[]; |
| 158 static const char kResetScreenName[]; |
| 156 | 159 |
| 157 private: | 160 private: |
| 158 // Show specific screen. | 161 // Show specific screen. |
| 159 void ShowNetworkScreen(); | 162 void ShowNetworkScreen(); |
| 160 void ShowUpdateScreen(); | 163 void ShowUpdateScreen(); |
| 161 void ShowUserImageScreen(); | 164 void ShowUserImageScreen(); |
| 162 void ShowEulaScreen(); | 165 void ShowEulaScreen(); |
| 163 void ShowRegistrationScreen(); | 166 void ShowRegistrationScreen(); |
| 164 void ShowHTMLPageScreen(); | 167 void ShowHTMLPageScreen(); |
| 165 void ShowEnterpriseEnrollmentScreen(); | 168 void ShowEnterpriseEnrollmentScreen(); |
| 169 void ShowResetScreen(); |
| 166 | 170 |
| 167 // Shows images login screen. | 171 // Shows images login screen. |
| 168 void ShowLoginScreen(); | 172 void ShowLoginScreen(); |
| 169 | 173 |
| 170 // Resumes a pending login screen. | 174 // Resumes a pending login screen. |
| 171 void ResumeLoginScreen(); | 175 void ResumeLoginScreen(); |
| 172 | 176 |
| 173 // Exit handlers: | 177 // Exit handlers: |
| 174 void OnNetworkConnected(); | 178 void OnNetworkConnected(); |
| 175 void OnNetworkOffline(); | 179 void OnNetworkOffline(); |
| 176 void OnConnectionFailed(); | 180 void OnConnectionFailed(); |
| 177 void OnUpdateCompleted(); | 181 void OnUpdateCompleted(); |
| 178 void OnEulaAccepted(); | 182 void OnEulaAccepted(); |
| 179 void OnUpdateErrorCheckingForUpdate(); | 183 void OnUpdateErrorCheckingForUpdate(); |
| 180 void OnUpdateErrorUpdating(); | 184 void OnUpdateErrorUpdating(); |
| 181 void OnUserImageSelected(); | 185 void OnUserImageSelected(); |
| 182 void OnUserImageSkipped(); | 186 void OnUserImageSkipped(); |
| 183 void OnRegistrationSuccess(); | 187 void OnRegistrationSuccess(); |
| 184 void OnRegistrationSkipped(); | 188 void OnRegistrationSkipped(); |
| 185 void OnEnterpriseEnrollmentDone(); | 189 void OnEnterpriseEnrollmentDone(); |
| 186 void OnEnterpriseAutoEnrollmentDone(); | 190 void OnEnterpriseAutoEnrollmentDone(); |
| 191 void OnResetCanceled(); |
| 187 void OnOOBECompleted(); | 192 void OnOOBECompleted(); |
| 188 | 193 |
| 189 // Shows update screen and starts update process. | 194 // Shows update screen and starts update process. |
| 190 void InitiateOOBEUpdate(); | 195 void InitiateOOBEUpdate(); |
| 191 | 196 |
| 192 // Actions that should be done right after EULA is accepted, | 197 // Actions that should be done right after EULA is accepted, |
| 193 // before update check. | 198 // before update check. |
| 194 void PerformPostEulaActions(); | 199 void PerformPostEulaActions(); |
| 195 | 200 |
| 196 // Actions that should be done right after update stage is finished. | 201 // Actions that should be done right after update stage is finished. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 220 static bool skip_user_image_selection_; | 225 static bool skip_user_image_selection_; |
| 221 | 226 |
| 222 static bool zero_delay_enabled_; | 227 static bool zero_delay_enabled_; |
| 223 | 228 |
| 224 // Screens. | 229 // Screens. |
| 225 scoped_ptr<NetworkScreen> network_screen_; | 230 scoped_ptr<NetworkScreen> network_screen_; |
| 226 scoped_ptr<UpdateScreen> update_screen_; | 231 scoped_ptr<UpdateScreen> update_screen_; |
| 227 scoped_ptr<UserImageScreen> user_image_screen_; | 232 scoped_ptr<UserImageScreen> user_image_screen_; |
| 228 scoped_ptr<EulaScreen> eula_screen_; | 233 scoped_ptr<EulaScreen> eula_screen_; |
| 229 scoped_ptr<RegistrationScreen> registration_screen_; | 234 scoped_ptr<RegistrationScreen> registration_screen_; |
| 235 scoped_ptr<ResetScreen> reset_screen_; |
| 230 scoped_ptr<HTMLPageScreen> html_page_screen_; | 236 scoped_ptr<HTMLPageScreen> html_page_screen_; |
| 231 scoped_ptr<EnterpriseEnrollmentScreen> | 237 scoped_ptr<EnterpriseEnrollmentScreen> |
| 232 enterprise_enrollment_screen_; | 238 enterprise_enrollment_screen_; |
| 233 | 239 |
| 234 // Screen that's currently active. | 240 // Screen that's currently active. |
| 235 WizardScreen* current_screen_; | 241 WizardScreen* current_screen_; |
| 236 | 242 |
| 243 // Screen that was active before, or NULL for login screen. |
| 244 WizardScreen* previous_screen_; |
| 245 |
| 237 std::string username_; | 246 std::string username_; |
| 238 std::string password_; | 247 std::string password_; |
| 239 | 248 |
| 240 // True if running official BUILD. | 249 // True if running official BUILD. |
| 241 bool is_official_build_; | 250 bool is_official_build_; |
| 242 | 251 |
| 243 // True if full OOBE flow should be shown. | 252 // True if full OOBE flow should be shown. |
| 244 bool is_out_of_box_; | 253 bool is_out_of_box_; |
| 245 | 254 |
| 246 // Value of the screen name that WizardController was started with. | 255 // Value of the screen name that WizardController was started with. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, Accelerators); | 288 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, Accelerators); |
| 280 friend class WizardControllerFlowTest; | 289 friend class WizardControllerFlowTest; |
| 281 friend class WizardInProcessBrowserTest; | 290 friend class WizardInProcessBrowserTest; |
| 282 | 291 |
| 283 DISALLOW_COPY_AND_ASSIGN(WizardController); | 292 DISALLOW_COPY_AND_ASSIGN(WizardController); |
| 284 }; | 293 }; |
| 285 | 294 |
| 286 } // namespace chromeos | 295 } // namespace chromeos |
| 287 | 296 |
| 288 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 297 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| OLD | NEW |