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/signin_specifics.h" | |
15 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h" | 14 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h" |
16 #include "chrome/browser/chromeos/login/users/user.h" | 15 #include "chrome/browser/chromeos/login/users/user.h" |
17 #include "chrome/browser/chromeos/login/users/user_manager.h" | 16 #include "chrome/browser/chromeos/login/users/user_manager.h" |
18 #include "ui/gfx/image/image.h" | 17 #include "ui/gfx/image/image.h" |
19 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
20 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
21 | 20 |
22 namespace chromeos { | 21 namespace chromeos { |
23 | 22 |
24 class UserContext; | 23 class UserContext; |
25 | 24 |
26 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. | 25 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. |
27 // An abstract class that defines login UI implementation. | 26 // An abstract class that defines login UI implementation. |
28 class LoginDisplay : public RemoveUserDelegate { | 27 class LoginDisplay : public RemoveUserDelegate { |
29 public: | 28 public: |
30 // 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 |
31 // a simple error bubble. | 30 // a simple error bubble. |
32 enum SigninError { | 31 enum SigninError { |
33 // Shown in case of critical TPM error. | 32 // Shown in case of critical TPM error. |
34 TPM_ERROR, | 33 TPM_ERROR, |
35 }; | 34 }; |
36 | 35 |
37 class Delegate { | 36 class Delegate { |
38 public: | 37 public: |
39 // Cancels current password changed flow. | 38 // Cancels current password changed flow. |
40 virtual void CancelPasswordChangedFlow() = 0; | 39 virtual void CancelPasswordChangedFlow() = 0; |
41 | 40 |
42 // Ignore password change, remove existing cryptohome and | |
43 // force full sync of user data. | |
44 virtual void ResyncUserData() = 0; | |
45 | |
46 // Decrypt cryptohome using user provided |old_password| | |
47 // and migrate to new password. | |
48 virtual void MigrateUserData(const std::string& old_password) = 0; | |
49 | |
50 // Sign in using |username| and |password| specified. | |
51 // Used for known users only. | |
52 virtual void Login(const UserContext& user_context, | |
53 const SigninSpecifics& specifics) = 0; | |
54 | |
55 // Returns true if sign in is in progress. | |
56 virtual bool IsSigninInProgress() const = 0; | |
57 | |
58 // Sign out the currently signed in user. | |
59 // Used when the lock screen is being displayed. | |
60 virtual void Signout() = 0; | |
61 | |
62 // Create new Google account. | 41 // Create new Google account. |
63 virtual void CreateAccount() = 0; | 42 virtual void CreateAccount() = 0; |
64 | 43 |
65 // Complete sign process with specified |user_context|. | 44 // Complete sign process with specified |user_context|. |
66 // Used for new users authenticated through an extension. | 45 // Used for new users authenticated through an extension. |
67 virtual void CompleteLogin(const UserContext& user_context) = 0; | 46 virtual void CompleteLogin(const UserContext& user_context) = 0; |
68 | 47 |
| 48 // Returns name of the currently connected network. |
| 49 virtual base::string16 GetConnectedNetworkName() = 0; |
| 50 |
| 51 // Returns true if sign in is in progress. |
| 52 virtual bool IsSigninInProgress() const = 0; |
| 53 |
| 54 // Sign in using |username| and |password| specified. |
| 55 // Used for known users only. |
| 56 virtual void Login(const UserContext& user_context) = 0; |
| 57 |
| 58 // Sign in as a retail mode user. |
| 59 virtual void LoginAsRetailModeUser() = 0; |
| 60 |
| 61 // Sign in into guest session. |
| 62 virtual void LoginAsGuest() = 0; |
| 63 |
| 64 // Decrypt cryptohome using user provided |old_password| |
| 65 // and migrate to new password. |
| 66 virtual void MigrateUserData(const std::string& old_password) = 0; |
| 67 |
| 68 // Sign in into the public account identified by |username|. |
| 69 virtual void LoginAsPublicAccount(const std::string& username) = 0; |
| 70 |
| 71 // Login to kiosk mode for app with |app_id|. |
| 72 virtual void LoginAsKioskApp(const std::string& app_id, |
| 73 bool diagnostic_mode) = 0; |
| 74 |
69 // Notify the delegate when the sign-in UI is finished loading. | 75 // Notify the delegate when the sign-in UI is finished loading. |
70 virtual void OnSigninScreenReady() = 0; | 76 virtual void OnSigninScreenReady() = 0; |
71 | 77 |
| 78 // Called when existing user pod is selected in the UI. |
| 79 virtual void OnUserSelected(const std::string& username) = 0; |
| 80 |
72 // Called when the user requests enterprise enrollment. | 81 // Called when the user requests enterprise enrollment. |
73 virtual void OnStartEnterpriseEnrollment() = 0; | 82 virtual void OnStartEnterpriseEnrollment() = 0; |
74 | 83 |
75 // Called when the user requests kiosk enable screen. | 84 // Called when the user requests kiosk enable screen. |
76 virtual void OnStartKioskEnableScreen() = 0; | 85 virtual void OnStartKioskEnableScreen() = 0; |
77 | 86 |
78 // Called when the owner permission for kiosk app auto launch is requested. | 87 // Called when the owner permission for kiosk app auto launch is requested. |
79 virtual void OnStartKioskAutolaunchScreen() = 0; | 88 virtual void OnStartKioskAutolaunchScreen() = 0; |
80 | 89 |
81 // Shows wrong HWID screen. | 90 // Shows wrong HWID screen. |
82 virtual void ShowWrongHWIDScreen() = 0; | 91 virtual void ShowWrongHWIDScreen() = 0; |
83 | 92 |
| 93 // Restarts the public-session auto-login timer if it is running. |
| 94 virtual void ResetPublicSessionAutoLoginTimer() = 0; |
| 95 |
| 96 // Ignore password change, remove existing cryptohome and |
| 97 // force full sync of user data. |
| 98 virtual void ResyncUserData() = 0; |
| 99 |
84 // Sets the displayed email for the next login attempt with |CompleteLogin|. | 100 // Sets the displayed email for the next login attempt with |CompleteLogin|. |
85 // If it succeeds, user's displayed email value will be updated to |email|. | 101 // If it succeeds, user's displayed email value will be updated to |email|. |
86 virtual void SetDisplayEmail(const std::string& email) = 0; | 102 virtual void SetDisplayEmail(const std::string& email) = 0; |
87 | 103 |
88 // Returns name of the currently connected network, for error message, | 104 // Sign out the currently signed in user. |
89 virtual base::string16 GetConnectedNetworkName() = 0; | 105 // Used when the lock screen is being displayed. |
90 | 106 virtual void Signout() = 0; |
91 // Restarts the public-session auto-login timer if it is running. | |
92 virtual void ResetPublicSessionAutoLoginTimer() = 0; | |
93 | 107 |
94 protected: | 108 protected: |
95 virtual ~Delegate(); | 109 virtual ~Delegate(); |
96 }; | 110 }; |
97 | 111 |
98 // |background_bounds| determines the bounds of login UI background. | 112 // |background_bounds| determines the bounds of login UI background. |
99 LoginDisplay(Delegate* delegate, const gfx::Rect& background_bounds); | 113 LoginDisplay(Delegate* delegate, const gfx::Rect& background_bounds); |
100 virtual ~LoginDisplay(); | 114 virtual ~LoginDisplay(); |
101 | 115 |
102 // Clears and enables fields on user pod or GAIA frame. | 116 // Clears and enables fields on user pod or GAIA frame. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // in redesigned login stack. | 185 // in redesigned login stack. |
172 // Login stack (and this object) will be recreated for next user sign in. | 186 // Login stack (and this object) will be recreated for next user sign in. |
173 bool is_signin_completed_; | 187 bool is_signin_completed_; |
174 | 188 |
175 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); | 189 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); |
176 }; | 190 }; |
177 | 191 |
178 } // namespace chromeos | 192 } // namespace chromeos |
179 | 193 |
180 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ | 194 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ |
OLD | NEW |