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 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class PrefRegistrySimple; | 24 class PrefRegistrySimple; |
25 class PrefService; | 25 class PrefService; |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 class DictionaryValue; | 28 class DictionaryValue; |
29 } | 29 } |
30 | 30 |
31 namespace chromeos { | 31 namespace chromeos { |
32 | 32 |
33 class AutoEnrollmentCheckStep; | 33 class AutoEnrollmentCheckScreen; |
34 class EnrollmentScreen; | 34 class EnrollmentScreen; |
35 class ErrorScreen; | 35 class ErrorScreen; |
36 class EulaScreen; | 36 class EulaScreen; |
37 class HIDDetectionScreen; | 37 class HIDDetectionScreen; |
38 struct Geoposition; | 38 struct Geoposition; |
39 class KioskAutolaunchScreen; | 39 class KioskAutolaunchScreen; |
40 class KioskEnableScreen; | 40 class KioskEnableScreen; |
41 class LocallyManagedUserCreationScreen; | 41 class LocallyManagedUserCreationScreen; |
42 class LoginDisplayHost; | 42 class LoginDisplayHost; |
43 class LoginScreenContext; | 43 class LoginScreenContext; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 NetworkScreen* GetNetworkScreen(); | 123 NetworkScreen* GetNetworkScreen(); |
124 UpdateScreen* GetUpdateScreen(); | 124 UpdateScreen* GetUpdateScreen(); |
125 UserImageScreen* GetUserImageScreen(); | 125 UserImageScreen* GetUserImageScreen(); |
126 EulaScreen* GetEulaScreen(); | 126 EulaScreen* GetEulaScreen(); |
127 EnrollmentScreen* GetEnrollmentScreen(); | 127 EnrollmentScreen* GetEnrollmentScreen(); |
128 ResetScreen* GetResetScreen(); | 128 ResetScreen* GetResetScreen(); |
129 KioskAutolaunchScreen* GetKioskAutolaunchScreen(); | 129 KioskAutolaunchScreen* GetKioskAutolaunchScreen(); |
130 KioskEnableScreen* GetKioskEnableScreen(); | 130 KioskEnableScreen* GetKioskEnableScreen(); |
131 TermsOfServiceScreen* GetTermsOfServiceScreen(); | 131 TermsOfServiceScreen* GetTermsOfServiceScreen(); |
132 WrongHWIDScreen* GetWrongHWIDScreen(); | 132 WrongHWIDScreen* GetWrongHWIDScreen(); |
| 133 AutoEnrollmentCheckScreen* GetAutoEnrollmentCheckScreen(); |
133 HIDDetectionScreen* GetHIDDetectionScreen(); | 134 HIDDetectionScreen* GetHIDDetectionScreen(); |
134 LocallyManagedUserCreationScreen* GetLocallyManagedUserCreationScreen(); | 135 LocallyManagedUserCreationScreen* GetLocallyManagedUserCreationScreen(); |
135 | 136 |
136 // Returns a pointer to the current screen or NULL if there's no such | 137 // Returns a pointer to the current screen or NULL if there's no such |
137 // screen. | 138 // screen. |
138 WizardScreen* current_screen() const { return current_screen_; } | 139 WizardScreen* current_screen() const { return current_screen_; } |
139 | 140 |
140 // Returns true if the current wizard instance has reached the login screen. | 141 // Returns true if the current wizard instance has reached the login screen. |
141 bool login_screen_started() const { return login_screen_started_; } | 142 bool login_screen_started() const { return login_screen_started_; } |
142 | 143 |
143 static const char kNetworkScreenName[]; | 144 static const char kNetworkScreenName[]; |
144 static const char kLoginScreenName[]; | 145 static const char kLoginScreenName[]; |
145 static const char kUpdateScreenName[]; | 146 static const char kUpdateScreenName[]; |
146 static const char kUserImageScreenName[]; | 147 static const char kUserImageScreenName[]; |
147 static const char kOutOfBoxScreenName[]; | 148 static const char kOutOfBoxScreenName[]; |
148 static const char kTestNoScreenName[]; | 149 static const char kTestNoScreenName[]; |
149 static const char kEulaScreenName[]; | 150 static const char kEulaScreenName[]; |
150 static const char kEnrollmentScreenName[]; | 151 static const char kEnrollmentScreenName[]; |
151 static const char kResetScreenName[]; | 152 static const char kResetScreenName[]; |
152 static const char kKioskEnableScreenName[]; | 153 static const char kKioskEnableScreenName[]; |
153 static const char kKioskAutolaunchScreenName[]; | 154 static const char kKioskAutolaunchScreenName[]; |
154 static const char kErrorScreenName[]; | 155 static const char kErrorScreenName[]; |
155 static const char kTermsOfServiceScreenName[]; | 156 static const char kTermsOfServiceScreenName[]; |
| 157 static const char kAutoEnrollmentCheckScreenName[]; |
156 static const char kWrongHWIDScreenName[]; | 158 static const char kWrongHWIDScreenName[]; |
157 static const char kLocallyManagedUserCreationScreenName[]; | 159 static const char kLocallyManagedUserCreationScreenName[]; |
158 static const char kAppLaunchSplashScreenName[]; | 160 static const char kAppLaunchSplashScreenName[]; |
159 static const char kHIDDetectionScreenName []; | 161 static const char kHIDDetectionScreenName []; |
160 | 162 |
161 // Volume percent at which spoken feedback is still audible. | 163 // Volume percent at which spoken feedback is still audible. |
162 static const int kMinAudibleOutputVolumePercent; | 164 static const int kMinAudibleOutputVolumePercent; |
163 | 165 |
164 private: | 166 private: |
165 // Show specific screen. | 167 // Show specific screen. |
166 void ShowNetworkScreen(); | 168 void ShowNetworkScreen(); |
167 void ShowUpdateScreen(); | 169 void ShowUpdateScreen(); |
168 void ShowUserImageScreen(); | 170 void ShowUserImageScreen(); |
169 void ShowEulaScreen(); | 171 void ShowEulaScreen(); |
170 void ShowEnrollmentScreen(); | 172 void ShowEnrollmentScreen(); |
171 void ShowResetScreen(); | 173 void ShowResetScreen(); |
172 void ShowKioskAutolaunchScreen(); | 174 void ShowKioskAutolaunchScreen(); |
173 void ShowKioskEnableScreen(); | 175 void ShowKioskEnableScreen(); |
174 void ShowTermsOfServiceScreen(); | 176 void ShowTermsOfServiceScreen(); |
175 void ShowWrongHWIDScreen(); | 177 void ShowWrongHWIDScreen(); |
| 178 void ShowAutoEnrollmentCheckScreen(); |
176 void ShowLocallyManagedUserCreationScreen(); | 179 void ShowLocallyManagedUserCreationScreen(); |
177 void ShowHIDDetectionScreen(); | 180 void ShowHIDDetectionScreen(); |
178 | 181 |
179 // Shows images login screen. | 182 // Shows images login screen. |
180 void ShowLoginScreen(const LoginScreenContext& context); | 183 void ShowLoginScreen(const LoginScreenContext& context); |
181 | 184 |
182 // Resumes a pending login screen. | 185 // Resumes a pending login screen. |
183 void ResumeLoginScreen(); | 186 void ResumeLoginScreen(); |
184 | 187 |
185 // Exit handlers: | 188 // Exit handlers: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 256 |
254 // Checks whether the user is allowed to exit enrollment. | 257 // Checks whether the user is allowed to exit enrollment. |
255 static bool CanExitEnrollment(); | 258 static bool CanExitEnrollment(); |
256 | 259 |
257 // Gets the management domain. | 260 // Gets the management domain. |
258 static std::string GetForcedEnrollmentDomain(); | 261 static std::string GetForcedEnrollmentDomain(); |
259 | 262 |
260 // Called when LocalState is initialized. | 263 // Called when LocalState is initialized. |
261 void OnLocalStateInitialized(bool /* succeeded */); | 264 void OnLocalStateInitialized(bool /* succeeded */); |
262 | 265 |
263 // Kicks off the auto-enrollment check step. Once it finishes, it'll call | |
264 // back via ScreenObserver::OnExit(). | |
265 void StartAutoEnrollmentCheck(); | |
266 | |
267 // Returns local state. | 266 // Returns local state. |
268 PrefService* GetLocalState(); | 267 PrefService* GetLocalState(); |
269 | 268 |
270 static void set_local_state_for_testing(PrefService* local_state) { | 269 static void set_local_state_for_testing(PrefService* local_state) { |
271 local_state_for_testing_ = local_state; | 270 local_state_for_testing_ = local_state; |
272 } | 271 } |
273 | 272 |
274 std::string first_screen_name() { return first_screen_name_; } | 273 std::string first_screen_name() { return first_screen_name_; } |
275 | 274 |
276 // Called when network is UP. | 275 // Called when network is UP. |
(...skipping 26 matching lines...) Expand all Loading... |
303 scoped_ptr<UpdateScreen> update_screen_; | 302 scoped_ptr<UpdateScreen> update_screen_; |
304 scoped_ptr<UserImageScreen> user_image_screen_; | 303 scoped_ptr<UserImageScreen> user_image_screen_; |
305 scoped_ptr<EulaScreen> eula_screen_; | 304 scoped_ptr<EulaScreen> eula_screen_; |
306 scoped_ptr<ResetScreen> reset_screen_; | 305 scoped_ptr<ResetScreen> reset_screen_; |
307 scoped_ptr<KioskAutolaunchScreen> autolaunch_screen_; | 306 scoped_ptr<KioskAutolaunchScreen> autolaunch_screen_; |
308 scoped_ptr<KioskEnableScreen> kiosk_enable_screen_; | 307 scoped_ptr<KioskEnableScreen> kiosk_enable_screen_; |
309 scoped_ptr<EnrollmentScreen> enrollment_screen_; | 308 scoped_ptr<EnrollmentScreen> enrollment_screen_; |
310 scoped_ptr<ErrorScreen> error_screen_; | 309 scoped_ptr<ErrorScreen> error_screen_; |
311 scoped_ptr<TermsOfServiceScreen> terms_of_service_screen_; | 310 scoped_ptr<TermsOfServiceScreen> terms_of_service_screen_; |
312 scoped_ptr<WrongHWIDScreen> wrong_hwid_screen_; | 311 scoped_ptr<WrongHWIDScreen> wrong_hwid_screen_; |
| 312 scoped_ptr<AutoEnrollmentCheckScreen> auto_enrollment_check_screen_; |
313 scoped_ptr<LocallyManagedUserCreationScreen> | 313 scoped_ptr<LocallyManagedUserCreationScreen> |
314 locally_managed_user_creation_screen_; | 314 locally_managed_user_creation_screen_; |
315 scoped_ptr<HIDDetectionScreen> hid_detection_screen_; | 315 scoped_ptr<HIDDetectionScreen> hid_detection_screen_; |
316 | 316 |
317 // Screen that's currently active. | 317 // Screen that's currently active. |
318 WizardScreen* current_screen_; | 318 WizardScreen* current_screen_; |
319 | 319 |
320 // Screen that was active before, or NULL for login screen. | 320 // Screen that was active before, or NULL for login screen. |
321 WizardScreen* previous_screen_; | 321 WizardScreen* previous_screen_; |
322 | 322 |
323 std::string username_; | 323 std::string username_; |
324 std::string password_; | 324 std::string password_; |
325 | 325 |
326 // True if running official BUILD. | 326 // True if running official BUILD. |
327 bool is_official_build_; | 327 bool is_official_build_; |
328 | 328 |
329 // True if full OOBE flow should be shown. | 329 // True if full OOBE flow should be shown. |
330 bool is_out_of_box_; | 330 bool is_out_of_box_; |
331 | 331 |
332 // Value of the screen name that WizardController was started with. | 332 // Value of the screen name that WizardController was started with. |
333 std::string first_screen_name_; | 333 std::string first_screen_name_; |
334 | 334 |
335 // OOBE/login display host. | 335 // OOBE/login display host. |
336 LoginDisplayHost* host_; | 336 LoginDisplayHost* host_; |
337 | 337 |
338 // Default WizardController. | 338 // Default WizardController. |
339 static WizardController* default_controller_; | 339 static WizardController* default_controller_; |
340 | 340 |
341 // The auto-enrollment check step, currently active. | |
342 scoped_ptr<AutoEnrollmentCheckStep> auto_enrollment_check_step_; | |
343 | |
344 // Parameters for the first screen. May be NULL. | 341 // Parameters for the first screen. May be NULL. |
345 scoped_ptr<base::DictionaryValue> screen_parameters_; | 342 scoped_ptr<base::DictionaryValue> screen_parameters_; |
346 | 343 |
347 base::OneShotTimer<WizardController> smooth_show_timer_; | 344 base::OneShotTimer<WizardController> smooth_show_timer_; |
348 | 345 |
349 OobeDisplay* oobe_display_; | 346 OobeDisplay* oobe_display_; |
350 | 347 |
351 // State of Usage stat/error reporting checkbox on EULA screen | 348 // State of Usage stat/error reporting checkbox on EULA screen |
352 // during wizard lifetime. | 349 // during wizard lifetime. |
353 bool usage_statistics_reporting_; | 350 bool usage_statistics_reporting_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 base::Closure on_timezone_resolved_for_testing_; | 385 base::Closure on_timezone_resolved_for_testing_; |
389 | 386 |
390 base::WeakPtrFactory<WizardController> weak_factory_; | 387 base::WeakPtrFactory<WizardController> weak_factory_; |
391 | 388 |
392 DISALLOW_COPY_AND_ASSIGN(WizardController); | 389 DISALLOW_COPY_AND_ASSIGN(WizardController); |
393 }; | 390 }; |
394 | 391 |
395 } // namespace chromeos | 392 } // namespace chromeos |
396 | 393 |
397 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 394 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
OLD | NEW |