OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" | 19 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" |
20 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" | 20 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" |
21 #include "chrome/browser/chromeos/login/signin_specifics.h" | |
22 #include "chrome/browser/chromeos/login/ui/login_display.h" | 21 #include "chrome/browser/chromeos/login/ui/login_display.h" |
23 #include "chrome/browser/chromeos/login/users/user_manager.h" | 22 #include "chrome/browser/chromeos/login/users/user_manager.h" |
24 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 23 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
25 #include "chrome/browser/chromeos/settings/cros_settings.h" | 24 #include "chrome/browser/chromeos/settings/cros_settings.h" |
26 #include "chrome/browser/signin/screenlock_bridge.h" | 25 #include "chrome/browser/signin/screenlock_bridge.h" |
27 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 26 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
28 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
29 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 28 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
30 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 29 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
31 #include "chromeos/ime/ime_keyboard.h" | 30 #include "chromeos/ime/ime_keyboard.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool animated, | 93 bool animated, |
95 bool show_guest) = 0; | 94 bool show_guest) = 0; |
96 | 95 |
97 protected: | 96 protected: |
98 virtual ~LoginDisplayWebUIHandler() {} | 97 virtual ~LoginDisplayWebUIHandler() {} |
99 }; | 98 }; |
100 | 99 |
101 // An interface for SigninScreenHandler to call WebUILoginDisplay. | 100 // An interface for SigninScreenHandler to call WebUILoginDisplay. |
102 class SigninScreenHandlerDelegate { | 101 class SigninScreenHandlerDelegate { |
103 public: | 102 public: |
104 // --------------- Password change flow methods. | |
105 // Cancels current password changed flow. | 103 // Cancels current password changed flow. |
106 virtual void CancelPasswordChangedFlow() = 0; | 104 virtual void CancelPasswordChangedFlow() = 0; |
107 | 105 |
| 106 // Cancels user adding. |
| 107 virtual void CancelUserAdding() = 0; |
| 108 |
| 109 // Create a new Google account. |
| 110 virtual void CreateAccount() = 0; |
| 111 |
| 112 // Confirms sign up by provided credentials in |user_context|. |
| 113 // Used for new user login via GAIA extension. |
| 114 virtual void CompleteLogin(const UserContext& user_context) = 0; |
| 115 |
| 116 // Sign in using username and password specified as a part of |user_context|. |
| 117 // Used for both known and new users. |
| 118 virtual void Login(const UserContext& user_context) = 0; |
| 119 |
| 120 // Sign in into a retail mode session. |
| 121 virtual void LoginAsRetailModeUser() = 0; |
| 122 |
| 123 // Sign in into guest session. |
| 124 virtual void LoginAsGuest() = 0; |
| 125 |
| 126 // Sign in into the public account identified by |username|. |
| 127 virtual void LoginAsPublicAccount(const std::string& username) = 0; |
| 128 |
108 // Decrypt cryptohome using user provided |old_password| | 129 // Decrypt cryptohome using user provided |old_password| |
109 // and migrate to new password. | 130 // and migrate to new password. |
110 virtual void MigrateUserData(const std::string& old_password) = 0; | 131 virtual void MigrateUserData(const std::string& old_password) = 0; |
111 | 132 |
| 133 // Load wallpaper for given |username|. |
| 134 virtual void LoadWallpaper(const std::string& username) = 0; |
| 135 |
| 136 // Loads the default sign-in wallpaper. |
| 137 virtual void LoadSigninWallpaper() = 0; |
| 138 |
| 139 // Notify the delegate when the sign-in UI is finished loading. |
| 140 virtual void OnSigninScreenReady() = 0; |
| 141 |
| 142 // Attempts to remove given user. |
| 143 virtual void RemoveUser(const std::string& username) = 0; |
| 144 |
112 // Ignore password change, remove existing cryptohome and | 145 // Ignore password change, remove existing cryptohome and |
113 // force full sync of user data. | 146 // force full sync of user data. |
114 virtual void ResyncUserData() = 0; | 147 virtual void ResyncUserData() = 0; |
115 | 148 |
116 // --------------- Sign in/out methods. | |
117 // Sign in using username and password specified as a part of |user_context|. | |
118 // Used for both known and new users. | |
119 virtual void Login(const UserContext& user_context, | |
120 const SigninSpecifics& specifics) = 0; | |
121 | |
122 // Sign in as guest to create a new Google account. | |
123 virtual void CreateAccount() = 0; | |
124 | |
125 // Returns true if sign in is in progress. | |
126 virtual bool IsSigninInProgress() const = 0; | |
127 | |
128 // Signs out if the screen is currently locked. | |
129 virtual void Signout() = 0; | |
130 | |
131 // --------------- Account creation methods. | |
132 // Confirms sign up by provided credentials in |user_context|. | |
133 // Used for new user login via GAIA extension. | |
134 virtual void CompleteLogin(const UserContext& user_context) = 0; | |
135 | |
136 // --------------- Shared with login display methods. | |
137 // Notify the delegate when the sign-in UI is finished loading. | |
138 virtual void OnSigninScreenReady() = 0; | |
139 | |
140 // Shows Enterprise Enrollment screen. | 149 // Shows Enterprise Enrollment screen. |
141 virtual void ShowEnterpriseEnrollmentScreen() = 0; | 150 virtual void ShowEnterpriseEnrollmentScreen() = 0; |
142 | 151 |
143 // Shows Kiosk Enable screen. | 152 // Shows Kiosk Enable screen. |
144 virtual void ShowKioskEnableScreen() = 0; | 153 virtual void ShowKioskEnableScreen() = 0; |
145 | 154 |
146 // Shows Reset screen. | 155 // Shows Reset screen. |
147 virtual void ShowKioskAutolaunchScreen() = 0; | 156 virtual void ShowKioskAutolaunchScreen() = 0; |
148 | 157 |
149 // Show wrong hwid screen. | 158 // Show wrong hwid screen. |
150 virtual void ShowWrongHWIDScreen() = 0; | 159 virtual void ShowWrongHWIDScreen() = 0; |
151 | 160 |
152 // Sets the displayed email for the next login attempt. If it succeeds, | |
153 // user's displayed email value will be updated to |email|. | |
154 virtual void SetDisplayEmail(const std::string& email) = 0; | |
155 | |
156 // --------------- Rest of the methods. | |
157 // Cancels user adding. | |
158 virtual void CancelUserAdding() = 0; | |
159 | |
160 // Load wallpaper for given |username|. | |
161 virtual void LoadWallpaper(const std::string& username) = 0; | |
162 | |
163 // Loads the default sign-in wallpaper. | |
164 virtual void LoadSigninWallpaper() = 0; | |
165 | |
166 // Attempts to remove given user. | |
167 virtual void RemoveUser(const std::string& username) = 0; | |
168 | |
169 // Let the delegate know about the handler it is supposed to be using. | 161 // Let the delegate know about the handler it is supposed to be using. |
170 virtual void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) = 0; | 162 virtual void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) = 0; |
171 | 163 |
172 // Returns users list to be shown. | 164 // Returns users list to be shown. |
173 virtual const UserList& GetUsers() const = 0; | 165 virtual const UserList& GetUsers() const = 0; |
174 | 166 |
175 // Whether login as guest is available. | 167 // Whether login as guest is available. |
176 virtual bool IsShowGuest() const = 0; | 168 virtual bool IsShowGuest() const = 0; |
177 | 169 |
178 // Weather to show the user pods or only GAIA sign in. | 170 // Weather to show the user pods or only GAIA sign in. |
179 // Public sessions are always shown. | 171 // Public sessions are always shown. |
180 virtual bool IsShowUsers() const = 0; | 172 virtual bool IsShowUsers() const = 0; |
181 | 173 |
| 174 // Returns true if sign in is in progress. |
| 175 virtual bool IsSigninInProgress() const = 0; |
| 176 |
182 // Whether user sign in has completed. | 177 // Whether user sign in has completed. |
183 virtual bool IsUserSigninCompleted() const = 0; | 178 virtual bool IsUserSigninCompleted() const = 0; |
184 | 179 |
| 180 // Sets the displayed email for the next login attempt. If it succeeds, |
| 181 // user's displayed email value will be updated to |email|. |
| 182 virtual void SetDisplayEmail(const std::string& email) = 0; |
| 183 |
| 184 // Signs out if the screen is currently locked. |
| 185 virtual void Signout() = 0; |
| 186 |
| 187 // Login to kiosk mode for app with |app_id|. |
| 188 virtual void LoginAsKioskApp(const std::string& app_id, |
| 189 bool diagnostic_mode) = 0; |
| 190 |
185 // Request to (re)load user list. | 191 // Request to (re)load user list. |
186 virtual void HandleGetUsers() = 0; | 192 virtual void HandleGetUsers() = 0; |
187 | 193 |
188 // Set authentication type (for easier unlocking). | 194 // Set authentication type (for easier unlocking). |
189 virtual void SetAuthType( | 195 virtual void SetAuthType( |
190 const std::string& username, | 196 const std::string& username, |
191 ScreenlockBridge::LockHandler::AuthType auth_type) = 0; | 197 ScreenlockBridge::LockHandler::AuthType auth_type) = 0; |
192 | 198 |
193 // Get authentication type (for easier unlocking). | 199 // Get authentication type (for easier unlocking). |
194 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType( | 200 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType( |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; | 474 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; |
469 | 475 |
470 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; | 476 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; |
471 | 477 |
472 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 478 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
473 }; | 479 }; |
474 | 480 |
475 } // namespace chromeos | 481 } // namespace chromeos |
476 | 482 |
477 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 483 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
OLD | NEW |