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" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
| 17 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
17 #include "chrome/browser/chromeos/login/screens/screen_observer.h" | 18 #include "chrome/browser/chromeos/login/screens/screen_observer.h" |
18 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" | 19 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" |
19 #include "content/public/browser/notification_observer.h" | |
20 #include "content/public/browser/notification_registrar.h" | |
21 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
22 #include "url/gurl.h" | 21 #include "url/gurl.h" |
23 | 22 |
24 class PrefRegistrySimple; | 23 class PrefRegistrySimple; |
25 class PrefService; | 24 class PrefService; |
26 | 25 |
27 namespace base { | 26 namespace base { |
28 class DictionaryValue; | 27 class DictionaryValue; |
29 } | 28 } |
30 | 29 |
(...skipping 11 matching lines...) Expand all Loading... |
42 class OobeDisplay; | 41 class OobeDisplay; |
43 class ResetScreen; | 42 class ResetScreen; |
44 class TermsOfServiceScreen; | 43 class TermsOfServiceScreen; |
45 class UpdateScreen; | 44 class UpdateScreen; |
46 class UserImageScreen; | 45 class UserImageScreen; |
47 class WizardScreen; | 46 class WizardScreen; |
48 class WrongHWIDScreen; | 47 class WrongHWIDScreen; |
49 | 48 |
50 // Class that manages control flow between wizard screens. Wizard controller | 49 // Class that manages control flow between wizard screens. Wizard controller |
51 // interacts with screen controllers to move the user between screens. | 50 // interacts with screen controllers to move the user between screens. |
52 class WizardController : public ScreenObserver, | 51 class WizardController : public ScreenObserver { |
53 public content::NotificationObserver { | |
54 public: | 52 public: |
55 // Observes screen changes. | 53 // Observes screen changes. |
56 class Observer { | 54 class Observer { |
57 public: | 55 public: |
58 // Called before a screen change happens. | 56 // Called before a screen change happens. |
59 virtual void OnScreenChanged(WizardScreen* next_screen) = 0; | 57 virtual void OnScreenChanged(WizardScreen* next_screen) = 0; |
60 | 58 |
61 // Called after the browser session has started. | 59 // Called after the browser session has started. |
62 virtual void OnSessionStart() = 0; | 60 virtual void OnSessionStart() = 0; |
63 }; | 61 }; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 virtual void OnExit(ExitCodes exit_code) OVERRIDE; | 218 virtual void OnExit(ExitCodes exit_code) OVERRIDE; |
221 virtual void ShowCurrentScreen() OVERRIDE; | 219 virtual void ShowCurrentScreen() OVERRIDE; |
222 virtual void OnSetUserNamePassword(const std::string& username, | 220 virtual void OnSetUserNamePassword(const std::string& username, |
223 const std::string& password) OVERRIDE; | 221 const std::string& password) OVERRIDE; |
224 virtual void SetUsageStatisticsReporting(bool val) OVERRIDE; | 222 virtual void SetUsageStatisticsReporting(bool val) OVERRIDE; |
225 virtual bool GetUsageStatisticsReporting() const OVERRIDE; | 223 virtual bool GetUsageStatisticsReporting() const OVERRIDE; |
226 virtual ErrorScreen* GetErrorScreen() OVERRIDE; | 224 virtual ErrorScreen* GetErrorScreen() OVERRIDE; |
227 virtual void ShowErrorScreen() OVERRIDE; | 225 virtual void ShowErrorScreen() OVERRIDE; |
228 virtual void HideErrorScreen(WizardScreen* parent_screen) OVERRIDE; | 226 virtual void HideErrorScreen(WizardScreen* parent_screen) OVERRIDE; |
229 | 227 |
230 // Overridden from content::NotificationObserver: | 228 // Notification of a change in the state of an accessibility setting. |
231 virtual void Observe(int type, | 229 void OnAccessibilityStatusChanged( |
232 const content::NotificationSource& source, | 230 const AccessibilityStatusEventDetails& details); |
233 const content::NotificationDetails& details) OVERRIDE; | |
234 | 231 |
235 // Switches from one screen to another. | 232 // Switches from one screen to another. |
236 void SetCurrentScreen(WizardScreen* screen); | 233 void SetCurrentScreen(WizardScreen* screen); |
237 | 234 |
238 // Switches from one screen to another with delay before showing. Calling | 235 // Switches from one screen to another with delay before showing. Calling |
239 // ShowCurrentScreen directly forces screen to be shown immediately. | 236 // ShowCurrentScreen directly forces screen to be shown immediately. |
240 void SetCurrentScreenSmooth(WizardScreen* screen, bool use_smoothing); | 237 void SetCurrentScreenSmooth(WizardScreen* screen, bool use_smoothing); |
241 | 238 |
242 // Changes status area visibility. | 239 // Changes status area visibility. |
243 void SetStatusAreaVisible(bool visible); | 240 void SetStatusAreaVisible(bool visible); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 332 |
336 // Non-owning pointer to local state used for testing. | 333 // Non-owning pointer to local state used for testing. |
337 static PrefService* local_state_for_testing_; | 334 static PrefService* local_state_for_testing_; |
338 | 335 |
339 FRIEND_TEST_ALL_PREFIXES(EnrollmentScreenTest, TestCancel); | 336 FRIEND_TEST_ALL_PREFIXES(EnrollmentScreenTest, TestCancel); |
340 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, Accelerators); | 337 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, Accelerators); |
341 friend class WizardControllerFlowTest; | 338 friend class WizardControllerFlowTest; |
342 friend class WizardInProcessBrowserTest; | 339 friend class WizardInProcessBrowserTest; |
343 friend class WizardControllerBrokenLocalStateTest; | 340 friend class WizardControllerBrokenLocalStateTest; |
344 | 341 |
| 342 scoped_ptr<AccessibilityStatusSubscription> accessibility_subscription_; |
| 343 |
345 base::WeakPtrFactory<WizardController> weak_factory_; | 344 base::WeakPtrFactory<WizardController> weak_factory_; |
346 | 345 |
347 content::NotificationRegistrar registrar_; | |
348 | |
349 DISALLOW_COPY_AND_ASSIGN(WizardController); | 346 DISALLOW_COPY_AND_ASSIGN(WizardController); |
350 }; | 347 }; |
351 | 348 |
352 } // namespace chromeos | 349 } // namespace chromeos |
353 | 350 |
354 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 351 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
OLD | NEW |