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