Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 class PrefService; | 22 class PrefService; |
| 23 class WizardContentsView; | 23 class WizardContentsView; |
| 24 class WizardScreen; | 24 class WizardScreen; |
| 25 | 25 |
| 26 namespace chromeos { | 26 namespace chromeos { |
| 27 class AccountScreen; | 27 class AccountScreen; |
| 28 class BackgroundView; | 28 class BackgroundView; |
| 29 class EulaScreen; | 29 class EulaScreen; |
| 30 class ExistingUserController; | 30 class ExistingUserController; |
| 31 class HTMLPageScreen; | 31 class HTMLPageScreen; |
| 32 class LoginScreen; | |
| 33 class NetworkScreen; | 32 class NetworkScreen; |
| 34 class RegistrationScreen; | 33 class RegistrationScreen; |
| 35 class StartupCustomizationDocument; | 34 class StartupCustomizationDocument; |
| 36 class UpdateScreen; | 35 class UpdateScreen; |
| 37 class UserImageScreen; | 36 class UserImageScreen; |
| 38 } | 37 } |
| 39 | 38 |
| 40 namespace gfx { | 39 namespace gfx { |
| 41 class Rect; | 40 class Rect; |
| 42 } | 41 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 98 |
| 100 // Takes ownership of the specified background widget and view. | 99 // Takes ownership of the specified background widget and view. |
| 101 void OwnBackground(views::Widget* background_widget, | 100 void OwnBackground(views::Widget* background_widget, |
| 102 chromeos::BackgroundView* background_view); | 101 chromeos::BackgroundView* background_view); |
| 103 | 102 |
| 104 // Skips OOBE update screen if it's currently shown. | 103 // Skips OOBE update screen if it's currently shown. |
| 105 void CancelOOBEUpdate(); | 104 void CancelOOBEUpdate(); |
| 106 | 105 |
| 107 // Lazy initializers and getters for screens. | 106 // Lazy initializers and getters for screens. |
| 108 chromeos::NetworkScreen* GetNetworkScreen(); | 107 chromeos::NetworkScreen* GetNetworkScreen(); |
| 109 chromeos::LoginScreen* GetLoginScreen(); | |
| 110 chromeos::AccountScreen* GetAccountScreen(); | 108 chromeos::AccountScreen* GetAccountScreen(); |
| 111 chromeos::UpdateScreen* GetUpdateScreen(); | 109 chromeos::UpdateScreen* GetUpdateScreen(); |
| 112 chromeos::UserImageScreen* GetUserImageScreen(); | 110 chromeos::UserImageScreen* GetUserImageScreen(); |
| 113 chromeos::EulaScreen* GetEulaScreen(); | 111 chromeos::EulaScreen* GetEulaScreen(); |
| 114 chromeos::RegistrationScreen* GetRegistrationScreen(); | 112 chromeos::RegistrationScreen* GetRegistrationScreen(); |
| 115 chromeos::HTMLPageScreen* GetHTMLPageScreen(); | 113 chromeos::HTMLPageScreen* GetHTMLPageScreen(); |
| 116 | 114 |
| 117 // Show specific screen. | 115 // Show specific screen. |
| 118 void ShowNetworkScreen(); | 116 void ShowNetworkScreen(); |
| 119 void ShowAccountScreen(); | 117 void ShowAccountScreen(); |
| 120 void ShowUpdateScreen(); | 118 void ShowUpdateScreen(); |
| 121 void ShowUserImageScreen(); | 119 void ShowUserImageScreen(); |
| 122 void ShowEulaScreen(); | 120 void ShowEulaScreen(); |
| 123 void ShowRegistrationScreen(); | 121 void ShowRegistrationScreen(); |
| 124 void ShowHTMLPageScreen(); | 122 void ShowHTMLPageScreen(); |
| 125 // Shows the default login screen and returns NULL or shows images login | 123 // Shows images login screen and returns the corresponding controller |
| 126 // screen and returns the corresponding controller instance for optional | 124 // instance for optional tweaking. |
| 127 // tweaking. | |
| 128 chromeos::ExistingUserController* ShowLoginScreen(); | 125 chromeos::ExistingUserController* ShowLoginScreen(); |
| 129 | 126 |
| 130 // Returns a pointer to the current screen or NULL if there's no such | 127 // Returns a pointer to the current screen or NULL if there's no such |
| 131 // screen. | 128 // screen. |
| 132 WizardScreen* current_screen() const { return current_screen_; } | 129 WizardScreen* current_screen() const { return current_screen_; } |
| 133 | 130 |
| 134 // Overrides observer for testing. | 131 // Overrides observer for testing. |
| 135 void set_observer(ScreenObserver* observer) { observer_ = observer; } | 132 void set_observer(ScreenObserver* observer) { observer_ = observer; } |
| 136 | 133 |
| 137 // Set URL to open on browser launch. | 134 // Set URL to open on browser launch. |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 162 static const char kEulaScreenName[]; | 159 static const char kEulaScreenName[]; |
| 163 static const char kHTMLPageScreenName[]; | 160 static const char kHTMLPageScreenName[]; |
| 164 | 161 |
| 165 // NotificationObserver implementation: | 162 // NotificationObserver implementation: |
| 166 virtual void Observe(NotificationType type, | 163 virtual void Observe(NotificationType type, |
| 167 const NotificationSource& source, | 164 const NotificationSource& source, |
| 168 const NotificationDetails& details); | 165 const NotificationDetails& details); |
| 169 | 166 |
| 170 private: | 167 private: |
| 171 // Exit handlers: | 168 // Exit handlers: |
| 172 void OnLoginSignInSelected(); | |
| 173 void OnLoginGuestUser(); | |
| 174 void OnLoginCreateAccount(); | |
| 175 void OnNetworkConnected(); | 169 void OnNetworkConnected(); |
| 176 void OnNetworkOffline(); | 170 void OnNetworkOffline(); |
| 177 void OnAccountCreateBack(); | 171 void OnAccountCreateBack(); |
| 178 void OnAccountCreated(); | 172 void OnAccountCreated(); |
| 179 void OnConnectionFailed(); | 173 void OnConnectionFailed(); |
| 180 void OnUpdateCompleted(); | 174 void OnUpdateCompleted(); |
| 181 void OnEulaAccepted(); | 175 void OnEulaAccepted(); |
| 182 void OnUpdateErrorCheckingForUpdate(); | 176 void OnUpdateErrorCheckingForUpdate(); |
| 183 void OnUpdateErrorUpdating(); | 177 void OnUpdateErrorUpdating(); |
| 184 void OnUserImageSelected(); | 178 void OnUserImageSelected(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 chromeos::BackgroundView* background_view_; | 224 chromeos::BackgroundView* background_view_; |
| 231 | 225 |
| 232 // Contents view. | 226 // Contents view. |
| 233 views::View* contents_; | 227 views::View* contents_; |
| 234 | 228 |
| 235 // Used to calculate position of the wizard screen. | 229 // Used to calculate position of the wizard screen. |
| 236 gfx::Rect screen_bounds_; | 230 gfx::Rect screen_bounds_; |
| 237 | 231 |
| 238 // Screens. | 232 // Screens. |
| 239 scoped_ptr<chromeos::NetworkScreen> network_screen_; | 233 scoped_ptr<chromeos::NetworkScreen> network_screen_; |
| 240 scoped_ptr<chromeos::LoginScreen> login_screen_; | |
| 241 scoped_ptr<chromeos::AccountScreen> account_screen_; | 234 scoped_ptr<chromeos::AccountScreen> account_screen_; |
| 242 scoped_ptr<chromeos::UpdateScreen> update_screen_; | 235 scoped_ptr<chromeos::UpdateScreen> update_screen_; |
| 243 scoped_ptr<chromeos::UserImageScreen> user_image_screen_; | 236 scoped_ptr<chromeos::UserImageScreen> user_image_screen_; |
| 244 scoped_ptr<chromeos::EulaScreen> eula_screen_; | 237 scoped_ptr<chromeos::EulaScreen> eula_screen_; |
| 245 scoped_ptr<chromeos::RegistrationScreen> registration_screen_; | 238 scoped_ptr<chromeos::RegistrationScreen> registration_screen_; |
| 246 scoped_ptr<chromeos::HTMLPageScreen> html_page_screen_; | 239 scoped_ptr<chromeos::HTMLPageScreen> html_page_screen_; |
| 247 | 240 |
| 248 // Screen that's currently active. | 241 // Screen that's currently active. |
| 249 WizardScreen* current_screen_; | 242 WizardScreen* current_screen_; |
| 250 | 243 |
| 251 std::string username_; | 244 std::string username_; |
| 252 std::string password_; | 245 std::string password_; |
| 253 | 246 |
| 254 // True if running official BUILD. | 247 // True if running official BUILD. |
| 255 bool is_official_build_; | 248 bool is_official_build_; |
| 256 | 249 |
| 257 // True if full OOBE flow should be shown. | 250 // True if full OOBE flow should be shown. |
| 258 bool is_out_of_box_; | 251 bool is_out_of_box_; |
| 259 | 252 |
| 260 // True if this is run under automation test and we need to show only | 253 // True if this is run under automation test and we need to show only |
| 261 // login screen. | 254 // login screen. |
| 262 bool is_test_mode_; | 255 bool is_test_mode_; |
|
Dmitry Polukhin
2010/12/14 14:06:18
It looks like we don't need it anymore.
whywhat
2010/12/16 10:47:52
Done.
| |
| 263 | 256 |
| 264 // Value of the screen name that WizardController was started with. | 257 // Value of the screen name that WizardController was started with. |
| 265 std::string first_screen_name_; | 258 std::string first_screen_name_; |
| 266 | 259 |
| 267 // NULL by default - controller itself is observer. Mock could be assigned. | 260 // NULL by default - controller itself is observer. Mock could be assigned. |
| 268 ScreenObserver* observer_; | 261 ScreenObserver* observer_; |
| 269 | 262 |
| 270 // Default WizardController. | 263 // Default WizardController. |
| 271 static WizardController* default_controller_; | 264 static WizardController* default_controller_; |
| 272 | 265 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 286 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, | 279 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, |
| 287 ControlFlowLanguageOnNetwork); | 280 ControlFlowLanguageOnNetwork); |
| 288 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowMain); | 281 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowMain); |
| 289 FRIEND_TEST_ALL_PREFIXES(WizardControllerTest, SwitchLanguage); | 282 FRIEND_TEST_ALL_PREFIXES(WizardControllerTest, SwitchLanguage); |
| 290 friend class WizardControllerFlowTest; | 283 friend class WizardControllerFlowTest; |
| 291 | 284 |
| 292 DISALLOW_COPY_AND_ASSIGN(WizardController); | 285 DISALLOW_COPY_AND_ASSIGN(WizardController); |
| 293 }; | 286 }; |
| 294 | 287 |
| 295 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 288 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| OLD | NEW |