OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_LOGIN_DISPLAY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_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/users/remove_user_delegate.h" | 14 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h" |
15 #include "chrome/browser/chromeos/login/users/user.h" | 15 #include "chrome/browser/chromeos/login/users/user.h" |
16 #include "chrome/browser/chromeos/login/users/user_manager.h" | 16 #include "chrome/browser/chromeos/login/users/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 UserContext; | 23 class UserContext; |
24 | 24 |
25 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. | 25 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. |
26 // An abstract class that defines login UI implementation. | 26 // An abstract class that defines login UI implementation. |
27 class LoginDisplay : public RemoveUserDelegate { | 27 class LoginDisplay : public RemoveUserDelegate { |
28 public: | 28 public: |
29 // Supported authentication types for login. | |
30 enum AuthType { | |
31 // Authenticates using the user's regular password. | |
32 OFFLINE_PASSWORD, | |
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 | |
44 // Sign in error IDs that require detailed error screen and not just | 29 // Sign in error IDs that require detailed error screen and not just |
45 // a simple error bubble. | 30 // a simple error bubble. |
46 enum SigninError { | 31 enum SigninError { |
47 // Shown in case of critical TPM error. | 32 // Shown in case of critical TPM error. |
48 TPM_ERROR, | 33 TPM_ERROR, |
49 }; | 34 }; |
50 | 35 |
51 class Delegate { | 36 class Delegate { |
52 public: | 37 public: |
53 // Cancels current password changed flow. | 38 // Cancels current password changed flow. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // Called when user is successfully authenticated. | 138 // Called when user is successfully authenticated. |
154 virtual void OnLoginSuccess(const std::string& username) = 0; | 139 virtual void OnLoginSuccess(const std::string& username) = 0; |
155 | 140 |
156 // Changes enabled state of the UI. | 141 // Changes enabled state of the UI. |
157 virtual void SetUIEnabled(bool is_enabled) = 0; | 142 virtual void SetUIEnabled(bool is_enabled) = 0; |
158 | 143 |
159 // Selects user entry with specified |index|. | 144 // Selects user entry with specified |index|. |
160 // Does nothing if current user is already selected. | 145 // Does nothing if current user is already selected. |
161 virtual void SelectPod(int index) = 0; | 146 virtual void SelectPod(int index) = 0; |
162 | 147 |
163 // Displays a banner on the login screen containing |message|. | |
164 virtual void ShowBannerMessage(const std::string& message) = 0; | |
165 | |
166 // Shows a button with an icon inside the user pod of |username|. | |
167 virtual void ShowUserPodButton(const std::string& username, | |
168 const std::string& iconURL, | |
169 const base::Closure& click_callback) = 0; | |
170 | |
171 // Hides the user pod button for a user. | |
172 virtual void HideUserPodButton(const std::string& username) = 0; | |
173 | |
174 // Set the authentication type to be used on the lock screen. | |
175 virtual void SetAuthType(const std::string& username, | |
176 AuthType auth_type, | |
177 const std::string& initial_value) = 0; | |
178 | |
179 // Returns the authentication type used for |username|. | |
180 virtual AuthType GetAuthType(const std::string& username) const = 0; | |
181 | |
182 // Displays simple error bubble with |error_msg_id| specified. | 148 // Displays simple error bubble with |error_msg_id| specified. |
183 // |login_attempts| shows number of login attempts made by current user. | 149 // |login_attempts| shows number of login attempts made by current user. |
184 // |help_topic_id| is additional help topic that is presented as link. | 150 // |help_topic_id| is additional help topic that is presented as link. |
185 virtual void ShowError(int error_msg_id, | 151 virtual void ShowError(int error_msg_id, |
186 int login_attempts, | 152 int login_attempts, |
187 HelpAppLauncher::HelpTopic help_topic_id) = 0; | 153 HelpAppLauncher::HelpTopic help_topic_id) = 0; |
188 | 154 |
189 // Displays detailed error screen for error with ID |error_id|. | 155 // Displays detailed error screen for error with ID |error_id|. |
190 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0; | 156 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0; |
191 | 157 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // in redesigned login stack. | 199 // in redesigned login stack. |
234 // Login stack (and this object) will be recreated for next user sign in. | 200 // Login stack (and this object) will be recreated for next user sign in. |
235 bool is_signin_completed_; | 201 bool is_signin_completed_; |
236 | 202 |
237 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); | 203 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); |
238 }; | 204 }; |
239 | 205 |
240 } // namespace chromeos | 206 } // namespace chromeos |
241 | 207 |
242 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ | 208 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ |
OLD | NEW |