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> |
ygorshenin1
2014/08/26 14:18:53
nit: add "#include <map>".
Denis Kuznetsov (DE-MUC)
2014/09/02 17:40:07
Done.
| |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
ygorshenin1
2014/08/26 14:18:53
nit: add #include "base/memory/linked_ptr.h".
Denis Kuznetsov (DE-MUC)
2014/09/02 17:40:07
Done.
| |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
19 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 19 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
20 #include "chrome/browser/chromeos/login/screens/screen_observer.h" | 20 #include "chrome/browser/chromeos/login/screens/screen_observer.h" |
21 | 21 |
22 class PrefRegistrySimple; | 22 class PrefRegistrySimple; |
23 class PrefService; | 23 class PrefService; |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class DictionaryValue; | 26 class DictionaryValue; |
27 } | 27 } |
28 | 28 |
29 namespace chromeos { | 29 namespace chromeos { |
30 | 30 |
31 class AutoEnrollmentCheckScreen; | 31 class AutoEnrollmentCheckScreen; |
32 class ControllerPairingScreen; | |
33 class EnrollmentScreen; | 32 class EnrollmentScreen; |
34 class ErrorScreen; | 33 class ErrorScreen; |
35 class EulaScreen; | |
36 struct Geoposition; | 34 struct Geoposition; |
37 class HIDDetectionScreen; | |
38 class HostPairingScreen; | |
39 class KioskAutolaunchScreen; | |
40 class KioskEnableScreen; | |
41 class LoginDisplayHost; | 35 class LoginDisplayHost; |
42 class LoginScreenContext; | 36 class LoginScreenContext; |
43 class NetworkScreen; | 37 class NetworkScreen; |
44 class OobeDisplay; | 38 class OobeDisplay; |
45 class ResetScreen; | |
46 class SimpleGeolocationProvider; | 39 class SimpleGeolocationProvider; |
47 class SupervisedUserCreationScreen; | 40 class SupervisedUserCreationScreen; |
48 class TermsOfServiceScreen; | |
49 class TimeZoneProvider; | 41 class TimeZoneProvider; |
50 struct TimeZoneResponseData; | 42 struct TimeZoneResponseData; |
51 class UpdateScreen; | 43 class UpdateScreen; |
52 class UserImageScreen; | 44 class UserImageScreen; |
53 class WizardScreen; | |
54 class WrongHWIDScreen; | |
55 | 45 |
56 // Class that manages control flow between wizard screens. Wizard controller | 46 // Class that manages control flow between wizard screens. Wizard controller |
57 // interacts with screen controllers to move the user between screens. | 47 // interacts with screen controllers to move the user between screens. |
58 class WizardController : public ScreenObserver { | 48 class WizardController : public ScreenObserver { |
59 public: | 49 public: |
60 // Observes screen changes. | 50 // Observes screen changes. |
61 class Observer { | 51 class Observer { |
62 public: | 52 public: |
63 // Called before a screen change happens. | 53 // Called before a screen change happens. |
64 virtual void OnScreenChanged(WizardScreen* next_screen) = 0; | 54 virtual void OnScreenChanged(WizardScreen* next_screen) = 0; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 void OnSessionStart(); | 113 void OnSessionStart(); |
124 | 114 |
125 // Skip update, go straight to enrollment after EULA is accepted. | 115 // Skip update, go straight to enrollment after EULA is accepted. |
126 void SkipUpdateEnrollAfterEula(); | 116 void SkipUpdateEnrollAfterEula(); |
127 | 117 |
128 // TODO(antrim) : temporary hack. Should be removed once screen system is | 118 // TODO(antrim) : temporary hack. Should be removed once screen system is |
129 // reworked at hackaton. | 119 // reworked at hackaton. |
130 void EnableUserImageScreenReturnToPreviousHack(); | 120 void EnableUserImageScreenReturnToPreviousHack(); |
131 | 121 |
132 // Lazy initializers and getters for screens. | 122 // Lazy initializers and getters for screens. |
123 WizardScreen* GetScreen(const std::string& screen_name); | |
124 WizardScreen* CreateScreen(const std::string& screen_name); | |
125 | |
126 // Typed getters for the screens. | |
133 NetworkScreen* GetNetworkScreen(); | 127 NetworkScreen* GetNetworkScreen(); |
134 UpdateScreen* GetUpdateScreen(); | 128 UpdateScreen* GetUpdateScreen(); |
135 UserImageScreen* GetUserImageScreen(); | 129 UserImageScreen* GetUserImageScreen(); |
136 EulaScreen* GetEulaScreen(); | |
ygorshenin1
2014/08/26 14:18:53
Why did you delete some getters, but leave others?
Denis Kuznetsov (DE-MUC)
2014/09/02 17:40:07
I've removed getters that were not used by other c
| |
137 EnrollmentScreen* GetEnrollmentScreen(); | 130 EnrollmentScreen* GetEnrollmentScreen(); |
138 ResetScreen* GetResetScreen(); | |
139 KioskAutolaunchScreen* GetKioskAutolaunchScreen(); | |
140 KioskEnableScreen* GetKioskEnableScreen(); | |
141 TermsOfServiceScreen* GetTermsOfServiceScreen(); | |
142 WrongHWIDScreen* GetWrongHWIDScreen(); | |
143 AutoEnrollmentCheckScreen* GetAutoEnrollmentCheckScreen(); | 131 AutoEnrollmentCheckScreen* GetAutoEnrollmentCheckScreen(); |
144 SupervisedUserCreationScreen* GetSupervisedUserCreationScreen(); | 132 SupervisedUserCreationScreen* GetSupervisedUserCreationScreen(); |
145 HIDDetectionScreen* GetHIDDetectionScreen(); | |
146 ControllerPairingScreen* GetControllerPairingScreen(); | |
147 HostPairingScreen* GetHostPairingScreen(); | |
148 | 133 |
149 // Returns a pointer to the current screen or NULL if there's no such | 134 // Returns a pointer to the current screen or NULL if there's no such |
150 // screen. | 135 // screen. |
151 WizardScreen* current_screen() const { return current_screen_; } | 136 WizardScreen* current_screen() const { return current_screen_; } |
152 | 137 |
153 // Returns true if the current wizard instance has reached the login screen. | 138 // Returns true if the current wizard instance has reached the login screen. |
154 bool login_screen_started() const { return login_screen_started_; } | 139 bool login_screen_started() const { return login_screen_started_; } |
155 | 140 |
156 static const char kNetworkScreenName[]; | 141 static const char kNetworkScreenName[]; |
157 static const char kLoginScreenName[]; | 142 static const char kLoginScreenName[]; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 // Returns false if timezone has already been resolved. | 297 // Returns false if timezone has already been resolved. |
313 bool SetOnTimeZoneResolvedForTesting(const base::Closure& callback); | 298 bool SetOnTimeZoneResolvedForTesting(const base::Closure& callback); |
314 | 299 |
315 // Whether to skip any screens that may normally be shown after login | 300 // Whether to skip any screens that may normally be shown after login |
316 // (registration, Terms of Service, user image selection). | 301 // (registration, Terms of Service, user image selection). |
317 static bool skip_post_login_screens_; | 302 static bool skip_post_login_screens_; |
318 | 303 |
319 static bool zero_delay_enabled_; | 304 static bool zero_delay_enabled_; |
320 | 305 |
321 // Screens. | 306 // Screens. |
322 scoped_ptr<NetworkScreen> network_screen_; | 307 |
323 scoped_ptr<UpdateScreen> update_screen_; | 308 typedef std::map<std::string, linked_ptr<WizardScreen> > ScreenMap; |
324 scoped_ptr<UserImageScreen> user_image_screen_; | 309 ScreenMap screens_; |
325 scoped_ptr<EulaScreen> eula_screen_; | |
326 scoped_ptr<ResetScreen> reset_screen_; | |
327 scoped_ptr<KioskAutolaunchScreen> autolaunch_screen_; | |
328 scoped_ptr<KioskEnableScreen> kiosk_enable_screen_; | |
329 scoped_ptr<EnrollmentScreen> enrollment_screen_; | |
330 scoped_ptr<ErrorScreen> error_screen_; | |
331 scoped_ptr<TermsOfServiceScreen> terms_of_service_screen_; | |
332 scoped_ptr<WrongHWIDScreen> wrong_hwid_screen_; | |
333 scoped_ptr<AutoEnrollmentCheckScreen> auto_enrollment_check_screen_; | |
334 scoped_ptr<SupervisedUserCreationScreen> supervised_user_creation_screen_; | |
335 scoped_ptr<HIDDetectionScreen> hid_detection_screen_; | |
336 scoped_ptr<ControllerPairingScreen> controller_pairing_screen_; | |
337 scoped_ptr<HostPairingScreen> host_pairing_screen_; | |
338 | 310 |
339 // Screen that's currently active. | 311 // Screen that's currently active. |
340 WizardScreen* current_screen_; | 312 WizardScreen* current_screen_; |
341 | 313 |
342 // Screen that was active before, or NULL for login screen. | 314 // Screen that was active before, or NULL for login screen. |
343 WizardScreen* previous_screen_; | 315 WizardScreen* previous_screen_; |
344 | 316 |
345 std::string username_; | 317 std::string username_; |
346 std::string password_; | 318 std::string password_; |
347 | 319 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
418 base::Closure on_timezone_resolved_for_testing_; | 390 base::Closure on_timezone_resolved_for_testing_; |
419 | 391 |
420 base::WeakPtrFactory<WizardController> weak_factory_; | 392 base::WeakPtrFactory<WizardController> weak_factory_; |
421 | 393 |
422 DISALLOW_COPY_AND_ASSIGN(WizardController); | 394 DISALLOW_COPY_AND_ASSIGN(WizardController); |
423 }; | 395 }; |
424 | 396 |
425 } // namespace chromeos | 397 } // namespace chromeos |
426 | 398 |
427 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 399 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
OLD | NEW |