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