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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
21 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 21 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
22 #include "chrome/browser/chromeos/login/screen_manager.h" | 22 #include "chrome/browser/chromeos/login/screen_manager.h" |
23 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 23 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
24 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h" | 24 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h" |
25 #include "chrome/browser/chromeos/login/screens/eula_screen.h" | 25 #include "chrome/browser/chromeos/login/screens/eula_screen.h" |
26 #include "chrome/browser/chromeos/login/screens/hid_detection_screen.h" | |
27 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h" | 26 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h" |
28 #include "chrome/browser/chromeos/login/screens/network_screen.h" | 27 #include "chrome/browser/chromeos/login/screens/network_screen.h" |
29 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 28 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
30 | 29 |
31 class PrefRegistrySimple; | 30 class PrefRegistrySimple; |
32 class PrefService; | 31 class PrefService; |
33 | 32 |
34 namespace pairing_chromeos { | 33 namespace pairing_chromeos { |
35 class ControllerPairingController; | 34 class ControllerPairingController; |
36 class HostPairingController; | 35 class HostPairingController; |
(...skipping 16 matching lines...) Expand all Loading... |
53 class UpdateScreen; | 52 class UpdateScreen; |
54 class UserImageScreen; | 53 class UserImageScreen; |
55 | 54 |
56 // Class that manages control flow between wizard screens. Wizard controller | 55 // Class that manages control flow between wizard screens. Wizard controller |
57 // interacts with screen controllers to move the user between screens. | 56 // interacts with screen controllers to move the user between screens. |
58 class WizardController : public BaseScreenDelegate, | 57 class WizardController : public BaseScreenDelegate, |
59 public ScreenManager, | 58 public ScreenManager, |
60 public EulaScreen::Delegate, | 59 public EulaScreen::Delegate, |
61 public ControllerPairingScreen::Delegate, | 60 public ControllerPairingScreen::Delegate, |
62 public HostPairingScreen::Delegate, | 61 public HostPairingScreen::Delegate, |
63 public NetworkScreen::Delegate, | 62 public NetworkScreen::Delegate { |
64 public HIDDetectionScreen::Delegate { | |
65 public: | 63 public: |
66 // Observes screen changes. | 64 // Observes screen changes. |
67 class Observer { | 65 class Observer { |
68 public: | 66 public: |
69 // Called before a screen change happens. | 67 // Called before a screen change happens. |
70 virtual void OnScreenChanged(BaseScreen* next_screen) = 0; | 68 virtual void OnScreenChanged(BaseScreen* next_screen) = 0; |
71 | 69 |
72 // Called after the browser session has started. | 70 // Called after the browser session has started. |
73 virtual void OnSessionStart() = 0; | 71 virtual void OnSessionStart() = 0; |
74 }; | 72 }; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void ShowAutoEnrollmentCheckScreen(); | 174 void ShowAutoEnrollmentCheckScreen(); |
177 void ShowSupervisedUserCreationScreen(); | 175 void ShowSupervisedUserCreationScreen(); |
178 void ShowHIDDetectionScreen(); | 176 void ShowHIDDetectionScreen(); |
179 void ShowControllerPairingScreen(); | 177 void ShowControllerPairingScreen(); |
180 void ShowHostPairingScreen(); | 178 void ShowHostPairingScreen(); |
181 void ShowDeviceDisabledScreen(); | 179 void ShowDeviceDisabledScreen(); |
182 | 180 |
183 // Shows images login screen. | 181 // Shows images login screen. |
184 void ShowLoginScreen(const LoginScreenContext& context); | 182 void ShowLoginScreen(const LoginScreenContext& context); |
185 | 183 |
| 184 // Invokes corresponding first OOBE screen. |
| 185 void OnHIDScreenNecessityCheck(bool screen_needed); |
| 186 |
186 // Exit handlers: | 187 // Exit handlers: |
187 void OnHIDDetectionCompleted(); | 188 void OnHIDDetectionCompleted(); |
188 void OnNetworkConnected(); | 189 void OnNetworkConnected(); |
189 void OnNetworkOffline(); | 190 void OnNetworkOffline(); |
190 void OnConnectionFailed(); | 191 void OnConnectionFailed(); |
191 void OnUpdateCompleted(); | 192 void OnUpdateCompleted(); |
192 void OnEulaAccepted(); | 193 void OnEulaAccepted(); |
193 void OnUpdateErrorCheckingForUpdate(); | 194 void OnUpdateErrorCheckingForUpdate(); |
194 void OnUpdateErrorUpdating(); | 195 void OnUpdateErrorUpdating(); |
195 void OnUserImageSelected(); | 196 void OnUserImageSelected(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // Override from HostPairingScreen::Delegate: | 250 // Override from HostPairingScreen::Delegate: |
250 void ConfigureHost(bool accepted_eula, | 251 void ConfigureHost(bool accepted_eula, |
251 const std::string& lang, | 252 const std::string& lang, |
252 const std::string& timezone, | 253 const std::string& timezone, |
253 bool send_reports, | 254 bool send_reports, |
254 const std::string& keyboard_layout) override; | 255 const std::string& keyboard_layout) override; |
255 | 256 |
256 // Override from NetworkScreen::Delegate: | 257 // Override from NetworkScreen::Delegate: |
257 void OnEnableDebuggingScreenRequested() override; | 258 void OnEnableDebuggingScreenRequested() override; |
258 | 259 |
259 // Override from HIDDetectionScreen::Delegate | |
260 void OnHIDScreenNecessityCheck(bool screen_needed) override; | |
261 | |
262 // Notification of a change in the state of an accessibility setting. | 260 // Notification of a change in the state of an accessibility setting. |
263 void OnAccessibilityStatusChanged( | 261 void OnAccessibilityStatusChanged( |
264 const AccessibilityStatusEventDetails& details); | 262 const AccessibilityStatusEventDetails& details); |
265 | 263 |
266 // Switches from one screen to another. | 264 // Switches from one screen to another. |
267 void SetCurrentScreen(BaseScreen* screen); | 265 void SetCurrentScreen(BaseScreen* screen); |
268 | 266 |
269 // Switches from one screen to another with delay before showing. Calling | 267 // Switches from one screen to another with delay before showing. Calling |
270 // ShowCurrentScreen directly forces screen to be shown immediately. | 268 // ShowCurrentScreen directly forces screen to be shown immediately. |
271 void SetCurrentScreenSmooth(BaseScreen* screen, bool use_smoothing); | 269 void SetCurrentScreenSmooth(BaseScreen* screen, bool use_smoothing); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 413 |
416 // True if shark device initiated connection to this device. | 414 // True if shark device initiated connection to this device. |
417 bool shark_controller_detected_; | 415 bool shark_controller_detected_; |
418 | 416 |
419 // Listens for incoming connection from a shark controller if a regular (not | 417 // Listens for incoming connection from a shark controller if a regular (not |
420 // pairing) remora OOBE is active. If connection is established, wizard | 418 // pairing) remora OOBE is active. If connection is established, wizard |
421 // conroller swithces to a pairing OOBE. | 419 // conroller swithces to a pairing OOBE. |
422 scoped_ptr<pairing_chromeos::SharkConnectionListener> | 420 scoped_ptr<pairing_chromeos::SharkConnectionListener> |
423 shark_connection_listener_; | 421 shark_connection_listener_; |
424 | 422 |
425 BaseScreen* hid_screen_; | |
426 | |
427 base::WeakPtrFactory<WizardController> weak_factory_; | 423 base::WeakPtrFactory<WizardController> weak_factory_; |
428 | 424 |
429 DISALLOW_COPY_AND_ASSIGN(WizardController); | 425 DISALLOW_COPY_AND_ASSIGN(WizardController); |
430 }; | 426 }; |
431 | 427 |
432 } // namespace chromeos | 428 } // namespace chromeos |
433 | 429 |
434 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 430 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
OLD | NEW |