| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Takes ownership of the specified background widget and view. | 65 // Takes ownership of the specified background widget and view. |
| 66 void OwnBackground(views::Widget* background_widget, | 66 void OwnBackground(views::Widget* background_widget, |
| 67 chromeos::BackgroundView* background_view); | 67 chromeos::BackgroundView* background_view); |
| 68 | 68 |
| 69 // Lazy initializers and getters for screens. | 69 // Lazy initializers and getters for screens. |
| 70 chromeos::NetworkScreen* GetNetworkScreen(); | 70 chromeos::NetworkScreen* GetNetworkScreen(); |
| 71 LoginScreen* GetLoginScreen(); | 71 LoginScreen* GetLoginScreen(); |
| 72 chromeos::AccountScreen* GetAccountScreen(); | 72 chromeos::AccountScreen* GetAccountScreen(); |
| 73 chromeos::UpdateScreen* GetUpdateScreen(); | 73 chromeos::UpdateScreen* GetUpdateScreen(); |
| 74 | 74 |
| 75 // Show specific screen. |
| 76 void ShowNetworkScreen(); |
| 77 void ShowLoginScreen(); |
| 78 void ShowAccountScreen(); |
| 79 void ShowUpdateScreen(); |
| 80 |
| 75 // Returns a pointer to the current screen or NULL if there's no such | 81 // Returns a pointer to the current screen or NULL if there's no such |
| 76 // screen. | 82 // screen. |
| 77 WizardScreen* current_screen() const { return current_screen_; } | 83 WizardScreen* current_screen() const { return current_screen_; } |
| 78 // Switches from one screen to another. | |
| 79 void SetCurrentScreen(WizardScreen* screen); | |
| 80 | 84 |
| 81 // Overrides observer for testing. | 85 // Overrides observer for testing. |
| 82 void set_observer(ScreenObserver* observer) { observer_ = observer; } | 86 void set_observer(ScreenObserver* observer) { observer_ = observer; } |
| 83 | 87 |
| 84 static const char kNetworkScreenName[]; | 88 static const char kNetworkScreenName[]; |
| 85 static const char kLoginScreenName[]; | 89 static const char kLoginScreenName[]; |
| 86 static const char kAccountScreenName[]; | 90 static const char kAccountScreenName[]; |
| 87 static const char kUpdateScreenName[]; | 91 static const char kUpdateScreenName[]; |
| 88 static const char kOutOfBoxScreenName[]; | 92 static const char kOutOfBoxScreenName[]; |
| 89 static const char kTestNoScreenName[]; | 93 static const char kTestNoScreenName[]; |
| 90 | 94 |
| 91 private: | 95 private: |
| 92 // Exit handlers: | 96 // Exit handlers: |
| 93 void OnLoginSignInSelected(); | 97 void OnLoginSignInSelected(); |
| 94 void OnLoginCreateAccount(); | 98 void OnLoginCreateAccount(); |
| 95 void OnNetworkConnected(); | 99 void OnNetworkConnected(); |
| 96 void OnNetworkOffline(); | 100 void OnNetworkOffline(); |
| 97 void OnAccountCreateBack(); | 101 void OnAccountCreateBack(); |
| 98 void OnAccountCreated(); | 102 void OnAccountCreated(); |
| 99 void OnConnectionFailed(); | 103 void OnConnectionFailed(); |
| 100 void OnUpdateCompleted(); | 104 void OnUpdateCompleted(); |
| 101 void OnUpdateNetworkError(); | 105 void OnUpdateNetworkError(); |
| 102 | 106 |
| 107 // Switches from one screen to another. |
| 108 void SetCurrentScreen(WizardScreen* screen); |
| 109 |
| 103 // Overridden from chromeos::ScreenObserver: | 110 // Overridden from chromeos::ScreenObserver: |
| 104 virtual void OnExit(ExitCodes exit_code); | 111 virtual void OnExit(ExitCodes exit_code); |
| 105 virtual void OnSetUserNamePassword(const std::string& username, | 112 virtual void OnSetUserNamePassword(const std::string& username, |
| 106 const std::string& password); | 113 const std::string& password); |
| 107 | 114 |
| 108 // Overridden from WizardScreenDelegate: | 115 // Overridden from WizardScreenDelegate: |
| 109 virtual views::View* GetWizardView(); | 116 virtual views::View* GetWizardView(); |
| 110 virtual chromeos::ScreenObserver* GetObserver(WizardScreen* screen); | 117 virtual chromeos::ScreenObserver* GetObserver(WizardScreen* screen); |
| 111 | 118 |
| 112 // Determines which screen to show first by the parameter, shows it and | 119 // Determines which screen to show first by the parameter, shows it and |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 FRIEND_TEST(WizardControllerFlowTest, ControlFlowErrorUpdate); | 155 FRIEND_TEST(WizardControllerFlowTest, ControlFlowErrorUpdate); |
| 149 FRIEND_TEST(WizardControllerFlowTest, ControlFlowLanguageOnLogin); | 156 FRIEND_TEST(WizardControllerFlowTest, ControlFlowLanguageOnLogin); |
| 150 FRIEND_TEST(WizardControllerFlowTest, ControlFlowLanguageOnNetwork); | 157 FRIEND_TEST(WizardControllerFlowTest, ControlFlowLanguageOnNetwork); |
| 151 FRIEND_TEST(WizardControllerFlowTest, ControlFlowMain); | 158 FRIEND_TEST(WizardControllerFlowTest, ControlFlowMain); |
| 152 FRIEND_TEST(WizardControllerTest, SwitchLanguage); | 159 FRIEND_TEST(WizardControllerTest, SwitchLanguage); |
| 153 friend class WizardControllerFlowTest; | 160 friend class WizardControllerFlowTest; |
| 154 DISALLOW_COPY_AND_ASSIGN(WizardController); | 161 DISALLOW_COPY_AND_ASSIGN(WizardController); |
| 155 }; | 162 }; |
| 156 | 163 |
| 157 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 164 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| OLD | NEW |