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_LOGIN_DISPLAY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 13 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
14 #include "chrome/browser/chromeos/login/remove_user_delegate.h" | 14 #include "chrome/browser/chromeos/login/remove_user_delegate.h" |
15 #include "chrome/browser/chromeos/login/user.h" | 15 #include "chrome/browser/chromeos/login/user.h" |
16 #include "chrome/browser/chromeos/login/user_manager.h" | 16 #include "chrome/browser/chromeos/login/user_manager.h" |
17 #include "ui/gfx/image/image.h" | 17 #include "ui/gfx/image/image.h" |
18 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
20 | 20 |
21 namespace chromeos { | 21 namespace chromeos { |
22 | 22 |
23 class ScreenLocker; | |
xiyuan
2014/02/16 18:38:14
nit: This seems not used.
Tim Song
2014/02/18 23:32:44
Done.
| |
24 | |
23 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. | 25 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. |
24 // An abstract class that defines login UI implementation. | 26 // An abstract class that defines login UI implementation. |
25 class LoginDisplay : public RemoveUserDelegate { | 27 class LoginDisplay : public RemoveUserDelegate { |
26 public: | 28 public: |
29 // Supported authentication types for login. | |
30 enum AuthType { | |
31 // Authenticates using the user's regular password. | |
32 SYSTEM_PASSWORD, | |
xiyuan
2014/02/16 18:38:14
nit: OFFLINE_PASSWORD. SYSTEM_PASSWORD is a bit c
Tim Song
2014/02/18 23:32:44
Done.
| |
33 | |
34 // Authenticates by forced online GAIA sign in. | |
35 ONLINE_SIGN_IN, | |
36 | |
37 // Authenticates with a 4 digit numeric pin. | |
38 NUMERIC_PIN, | |
39 | |
40 // Authenticates by clicking pod when it is focused. | |
41 USER_CLICK, | |
42 }; | |
43 | |
27 // Sign in error IDs that require detailed error screen and not just | 44 // Sign in error IDs that require detailed error screen and not just |
28 // a simple error bubble. | 45 // a simple error bubble. |
29 enum SigninError { | 46 enum SigninError { |
30 // Shown in case of critical TPM error. | 47 // Shown in case of critical TPM error. |
31 TPM_ERROR, | 48 TPM_ERROR, |
32 }; | 49 }; |
33 | 50 |
34 class Delegate { | 51 class Delegate { |
35 public: | 52 public: |
36 // Cancels current password changed flow. | 53 // Cancels current password changed flow. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 virtual void SelectPod(int index) = 0; | 164 virtual void SelectPod(int index) = 0; |
148 | 165 |
149 // Displays a banner on the login screen containing |message|. | 166 // Displays a banner on the login screen containing |message|. |
150 virtual void ShowBannerMessage(const std::string& message) = 0; | 167 virtual void ShowBannerMessage(const std::string& message) = 0; |
151 | 168 |
152 // Shows a button with an icon inside the user pod of |username|. | 169 // Shows a button with an icon inside the user pod of |username|. |
153 virtual void ShowUserPodButton(const std::string& username, | 170 virtual void ShowUserPodButton(const std::string& username, |
154 const std::string& iconURL, | 171 const std::string& iconURL, |
155 const base::Closure& click_callback) = 0; | 172 const base::Closure& click_callback) = 0; |
156 | 173 |
174 // Hides the user pod button for a user. | |
175 virtual void HideUserPodButton(const std::string& username) = 0; | |
176 | |
177 // Set the authentication type to be used on the lock screen. | |
178 virtual void SetAuthType(const std::string& username, | |
179 AuthType auth_type, | |
180 const std::string& initial_value) = 0; | |
181 | |
182 // Returns the authentication type used for |username|. | |
183 virtual AuthType GetAuthType(const std::string& username) const = 0; | |
184 | |
157 // Displays simple error bubble with |error_msg_id| specified. | 185 // Displays simple error bubble with |error_msg_id| specified. |
158 // |login_attempts| shows number of login attempts made by current user. | 186 // |login_attempts| shows number of login attempts made by current user. |
159 // |help_topic_id| is additional help topic that is presented as link. | 187 // |help_topic_id| is additional help topic that is presented as link. |
160 virtual void ShowError(int error_msg_id, | 188 virtual void ShowError(int error_msg_id, |
161 int login_attempts, | 189 int login_attempts, |
162 HelpAppLauncher::HelpTopic help_topic_id) = 0; | 190 HelpAppLauncher::HelpTopic help_topic_id) = 0; |
163 | 191 |
164 // Displays detailed error screen for error with ID |error_id|. | 192 // Displays detailed error screen for error with ID |error_id|. |
165 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0; | 193 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0; |
166 | 194 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 // in redesigned login stack. | 233 // in redesigned login stack. |
206 // Login stack (and this object) will be recreated for next user sign in. | 234 // Login stack (and this object) will be recreated for next user sign in. |
207 bool is_signin_completed_; | 235 bool is_signin_completed_; |
208 | 236 |
209 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); | 237 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); |
210 }; | 238 }; |
211 | 239 |
212 } // namespace chromeos | 240 } // namespace chromeos |
213 | 241 |
214 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ | 242 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ |
OLD | NEW |