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/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "chrome/browser/chromeos/login/screen_observer.h" | 12 #include "chrome/browser/chromeos/login/screen_observer.h" |
13 #include "chrome/browser/chromeos/login/view_screen.h" | 13 #include "chrome/browser/chromeos/login/view_screen.h" |
14 #include "chrome/browser/chromeos/login/wizard_screen.h" | 14 #include "chrome/browser/chromeos/login/wizard_screen.h" |
15 #include "testing/gtest/include/gtest/gtest_prod.h" | 15 #include "testing/gtest/include/gtest/gtest_prod.h" |
16 | 16 |
17 class WizardContentsView; | 17 class WizardContentsView; |
18 class WizardScreen; | 18 class WizardScreen; |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 class AccountScreen; | 21 class AccountScreen; |
22 class BackgroundView; | 22 class BackgroundView; |
23 class LoginScreen; | 23 class LoginScreen; |
24 class NetworkScreen; | 24 class NetworkScreen; |
25 class UserImageScreen; | |
26 class UpdateScreen; | 25 class UpdateScreen; |
27 class StartupCustomizationDocument; | 26 class StartupCustomizationDocument; |
28 } | 27 } |
29 | 28 |
30 namespace gfx { | 29 namespace gfx { |
31 class Rect; | 30 class Rect; |
32 } | 31 } |
33 | 32 |
34 namespace views { | 33 namespace views { |
35 class Views; | 34 class Views; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 68 |
70 // Takes ownership of the specified background widget and view. | 69 // Takes ownership of the specified background widget and view. |
71 void OwnBackground(views::Widget* background_widget, | 70 void OwnBackground(views::Widget* background_widget, |
72 chromeos::BackgroundView* background_view); | 71 chromeos::BackgroundView* background_view); |
73 | 72 |
74 // Lazy initializers and getters for screens. | 73 // Lazy initializers and getters for screens. |
75 chromeos::NetworkScreen* GetNetworkScreen(); | 74 chromeos::NetworkScreen* GetNetworkScreen(); |
76 chromeos::LoginScreen* GetLoginScreen(); | 75 chromeos::LoginScreen* GetLoginScreen(); |
77 chromeos::AccountScreen* GetAccountScreen(); | 76 chromeos::AccountScreen* GetAccountScreen(); |
78 chromeos::UpdateScreen* GetUpdateScreen(); | 77 chromeos::UpdateScreen* GetUpdateScreen(); |
79 chromeos::UserImageScreen* GetUserImageScreen(); | |
80 | 78 |
81 // Show specific screen. | 79 // Show specific screen. |
82 void ShowNetworkScreen(); | 80 void ShowNetworkScreen(); |
83 void ShowLoginScreen(); | 81 void ShowLoginScreen(); |
84 void ShowAccountScreen(); | 82 void ShowAccountScreen(); |
85 void ShowUpdateScreen(); | 83 void ShowUpdateScreen(); |
86 void ShowUserImageScreen(); | |
87 | 84 |
88 // Returns a pointer to the current screen or NULL if there's no such | 85 // Returns a pointer to the current screen or NULL if there's no such |
89 // screen. | 86 // screen. |
90 WizardScreen* current_screen() const { return current_screen_; } | 87 WizardScreen* current_screen() const { return current_screen_; } |
91 | 88 |
92 // Overrides observer for testing. | 89 // Overrides observer for testing. |
93 void set_observer(ScreenObserver* observer) { observer_ = observer; } | 90 void set_observer(ScreenObserver* observer) { observer_ = observer; } |
94 | 91 |
95 // Sets partner startup customization. WizardController takes ownership | 92 // Sets partner startup customization. WizardController takes ownership |
96 // of the document object. | 93 // of the document object. |
97 void SetCustomization( | 94 void SetCustomization( |
98 const chromeos::StartupCustomizationDocument* customization); | 95 const chromeos::StartupCustomizationDocument* customization); |
99 | 96 |
100 static const char kNetworkScreenName[]; | 97 static const char kNetworkScreenName[]; |
101 static const char kLoginScreenName[]; | 98 static const char kLoginScreenName[]; |
102 static const char kAccountScreenName[]; | 99 static const char kAccountScreenName[]; |
103 static const char kUpdateScreenName[]; | 100 static const char kUpdateScreenName[]; |
104 static const char kUserImageScreenName[]; | |
105 static const char kOutOfBoxScreenName[]; | 101 static const char kOutOfBoxScreenName[]; |
106 static const char kTestNoScreenName[]; | 102 static const char kTestNoScreenName[]; |
107 | 103 |
108 private: | 104 private: |
109 // Exit handlers: | 105 // Exit handlers: |
110 void OnLoginSignInSelected(); | 106 void OnLoginSignInSelected(); |
111 void OnLoginCreateAccount(); | 107 void OnLoginCreateAccount(); |
112 void OnNetworkConnected(); | 108 void OnNetworkConnected(); |
113 void OnNetworkOffline(); | 109 void OnNetworkOffline(); |
114 void OnAccountCreateBack(); | 110 void OnAccountCreateBack(); |
115 void OnAccountCreated(); | 111 void OnAccountCreated(); |
116 void OnConnectionFailed(); | 112 void OnConnectionFailed(); |
117 void OnUpdateCompleted(); | 113 void OnUpdateCompleted(); |
118 void OnUpdateErrorCheckingForUpdate(); | 114 void OnUpdateErrorCheckingForUpdate(); |
119 void OnUpdateErrorUpdating(); | 115 void OnUpdateErrorUpdating(); |
120 void OnUserImageSelected(); | |
121 void OnUserImageSkipped(); | |
122 | 116 |
123 // Switches from one screen to another. | 117 // Switches from one screen to another. |
124 void SetCurrentScreen(WizardScreen* screen); | 118 void SetCurrentScreen(WizardScreen* screen); |
125 | 119 |
126 // Changes status area visibility. | 120 // Changes status area visibility. |
127 void SetStatusAreaVisible(bool visible); | 121 void SetStatusAreaVisible(bool visible); |
128 | 122 |
129 // Overridden from chromeos::ScreenObserver: | 123 // Overridden from chromeos::ScreenObserver: |
130 virtual void OnExit(ExitCodes exit_code); | 124 virtual void OnExit(ExitCodes exit_code); |
131 virtual void OnSetUserNamePassword(const std::string& username, | 125 virtual void OnSetUserNamePassword(const std::string& username, |
(...skipping 15 matching lines...) Expand all Loading... |
147 chromeos::BackgroundView* background_view_; | 141 chromeos::BackgroundView* background_view_; |
148 | 142 |
149 // Contents view. | 143 // Contents view. |
150 views::View* contents_; | 144 views::View* contents_; |
151 | 145 |
152 // Screens. | 146 // Screens. |
153 scoped_ptr<chromeos::NetworkScreen> network_screen_; | 147 scoped_ptr<chromeos::NetworkScreen> network_screen_; |
154 scoped_ptr<chromeos::LoginScreen> login_screen_; | 148 scoped_ptr<chromeos::LoginScreen> login_screen_; |
155 scoped_ptr<chromeos::AccountScreen> account_screen_; | 149 scoped_ptr<chromeos::AccountScreen> account_screen_; |
156 scoped_ptr<chromeos::UpdateScreen> update_screen_; | 150 scoped_ptr<chromeos::UpdateScreen> update_screen_; |
157 scoped_ptr<chromeos::UserImageScreen> user_image_screen_; | |
158 | 151 |
159 // Screen that's currently active. | 152 // Screen that's currently active. |
160 WizardScreen* current_screen_; | 153 WizardScreen* current_screen_; |
161 | 154 |
162 std::string username_; | 155 std::string username_; |
163 std::string password_; | 156 std::string password_; |
164 | 157 |
165 // True if full OOBE flow should be shown. | 158 // True if full OOBE flow should be shown. |
166 bool is_out_of_box_; | 159 bool is_out_of_box_; |
167 | 160 |
(...skipping 13 matching lines...) Expand all Loading... |
181 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, | 174 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, |
182 ControlFlowLanguageOnNetwork); | 175 ControlFlowLanguageOnNetwork); |
183 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowMain); | 176 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowMain); |
184 FRIEND_TEST_ALL_PREFIXES(WizardControllerTest, SwitchLanguage); | 177 FRIEND_TEST_ALL_PREFIXES(WizardControllerTest, SwitchLanguage); |
185 friend class WizardControllerFlowTest; | 178 friend class WizardControllerFlowTest; |
186 | 179 |
187 DISALLOW_COPY_AND_ASSIGN(WizardController); | 180 DISALLOW_COPY_AND_ASSIGN(WizardController); |
188 }; | 181 }; |
189 | 182 |
190 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 183 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
OLD | NEW |