| 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 | |
| 42 // Sign in error IDs that require detailed error screen and not just | 27 // Sign in error IDs that require detailed error screen and not just |
| 43 // a simple error bubble. | 28 // a simple error bubble. |
| 44 enum SigninError { | 29 enum SigninError { |
| 45 // Shown in case of critical TPM error. | 30 // Shown in case of critical TPM error. |
| 46 TPM_ERROR, | 31 TPM_ERROR, |
| 47 }; | 32 }; |
| 48 | 33 |
| 49 class Delegate { | 34 class Delegate { |
| 50 public: | 35 public: |
| 51 // Cancels current password changed flow. | 36 // Cancels current password changed flow. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // Called when user is successfully authenticated. | 136 // Called when user is successfully authenticated. |
| 152 virtual void OnLoginSuccess(const std::string& username) = 0; | 137 virtual void OnLoginSuccess(const std::string& username) = 0; |
| 153 | 138 |
| 154 // Changes enabled state of the UI. | 139 // Changes enabled state of the UI. |
| 155 virtual void SetUIEnabled(bool is_enabled) = 0; | 140 virtual void SetUIEnabled(bool is_enabled) = 0; |
| 156 | 141 |
| 157 // Selects user entry with specified |index|. | 142 // Selects user entry with specified |index|. |
| 158 // Does nothing if current user is already selected. | 143 // Does nothing if current user is already selected. |
| 159 virtual void SelectPod(int index) = 0; | 144 virtual void SelectPod(int index) = 0; |
| 160 | 145 |
| 161 // Displays a banner on the login screen containing |message|. | |
| 162 virtual void ShowBannerMessage(const std::string& message) = 0; | |
| 163 | |
| 164 // Shows a button with an icon inside the user pod of |username|. | |
| 165 virtual void ShowUserPodButton(const std::string& username, | |
| 166 const std::string& iconURL, | |
| 167 const base::Closure& click_callback) = 0; | |
| 168 | |
| 169 // Hides the user pod button for a user. | |
| 170 virtual void HideUserPodButton(const std::string& username) = 0; | |
| 171 | |
| 172 // Set the authentication type to be used on the lock screen. | |
| 173 virtual void SetAuthType(const std::string& username, | |
| 174 AuthType auth_type, | |
| 175 const std::string& initial_value) = 0; | |
| 176 | |
| 177 // Returns the authentication type used for |username|. | |
| 178 virtual AuthType GetAuthType(const std::string& username) const = 0; | |
| 179 | |
| 180 // Displays simple error bubble with |error_msg_id| specified. | 146 // Displays simple error bubble with |error_msg_id| specified. |
| 181 // |login_attempts| shows number of login attempts made by current user. | 147 // |login_attempts| shows number of login attempts made by current user. |
| 182 // |help_topic_id| is additional help topic that is presented as link. | 148 // |help_topic_id| is additional help topic that is presented as link. |
| 183 virtual void ShowError(int error_msg_id, | 149 virtual void ShowError(int error_msg_id, |
| 184 int login_attempts, | 150 int login_attempts, |
| 185 HelpAppLauncher::HelpTopic help_topic_id) = 0; | 151 HelpAppLauncher::HelpTopic help_topic_id) = 0; |
| 186 | 152 |
| 187 // Displays detailed error screen for error with ID |error_id|. | 153 // Displays detailed error screen for error with ID |error_id|. |
| 188 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0; | 154 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0; |
| 189 | 155 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // in redesigned login stack. | 197 // in redesigned login stack. |
| 232 // Login stack (and this object) will be recreated for next user sign in. | 198 // Login stack (and this object) will be recreated for next user sign in. |
| 233 bool is_signin_completed_; | 199 bool is_signin_completed_; |
| 234 | 200 |
| 235 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); | 201 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); |
| 236 }; | 202 }; |
| 237 | 203 |
| 238 } // namespace chromeos | 204 } // namespace chromeos |
| 239 | 205 |
| 240 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ | 206 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ |
| OLD | NEW |