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