Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h

Issue 324463003: ChromeOS login webui refactoring : Simplify login methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
21 #include "chrome/browser/chromeos/login/ui/login_display.h" 22 #include "chrome/browser/chromeos/login/ui/login_display.h"
22 #include "chrome/browser/chromeos/login/users/user_manager.h" 23 #include "chrome/browser/chromeos/login/users/user_manager.h"
23 #include "chrome/browser/chromeos/net/network_portal_detector.h" 24 #include "chrome/browser/chromeos/net/network_portal_detector.h"
24 #include "chrome/browser/chromeos/settings/cros_settings.h" 25 #include "chrome/browser/chromeos/settings/cros_settings.h"
25 #include "chrome/browser/signin/screenlock_bridge.h" 26 #include "chrome/browser/signin/screenlock_bridge.h"
26 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" 27 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
27 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" 28 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
28 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" 29 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h"
29 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 30 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
30 #include "chromeos/ime/ime_keyboard.h" 31 #include "chromeos/ime/ime_keyboard.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 bool animated, 94 bool animated,
94 bool show_guest) = 0; 95 bool show_guest) = 0;
95 96
96 protected: 97 protected:
97 virtual ~LoginDisplayWebUIHandler() {} 98 virtual ~LoginDisplayWebUIHandler() {}
98 }; 99 };
99 100
100 // An interface for SigninScreenHandler to call WebUILoginDisplay. 101 // An interface for SigninScreenHandler to call WebUILoginDisplay.
101 class SigninScreenHandlerDelegate { 102 class SigninScreenHandlerDelegate {
102 public: 103 public:
104 // --------------- Password change flow methods.
103 // Cancels current password changed flow. 105 // Cancels current password changed flow.
104 virtual void CancelPasswordChangedFlow() = 0; 106 virtual void CancelPasswordChangedFlow() = 0;
105 107
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
129 // Decrypt cryptohome using user provided |old_password| 108 // Decrypt cryptohome using user provided |old_password|
130 // and migrate to new password. 109 // and migrate to new password.
131 virtual void MigrateUserData(const std::string& old_password) = 0; 110 virtual void MigrateUserData(const std::string& old_password) = 0;
132 111
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
145 // Ignore password change, remove existing cryptohome and 112 // Ignore password change, remove existing cryptohome and
146 // force full sync of user data. 113 // force full sync of user data.
147 virtual void ResyncUserData() = 0; 114 virtual void ResyncUserData() = 0;
148 115
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 // --------------- Account creation methods.
Nikita (slow) 2014/06/06 14:49:48 nit: should be updated
Denis Kuznetsov (DE-MUC) 2014/06/06 15:18:43 Done.
137 // Notify the delegate when the sign-in UI is finished loading.
138 virtual void OnSigninScreenReady() = 0;
139
149 // Shows Enterprise Enrollment screen. 140 // Shows Enterprise Enrollment screen.
150 virtual void ShowEnterpriseEnrollmentScreen() = 0; 141 virtual void ShowEnterpriseEnrollmentScreen() = 0;
151 142
152 // Shows Kiosk Enable screen. 143 // Shows Kiosk Enable screen.
153 virtual void ShowKioskEnableScreen() = 0; 144 virtual void ShowKioskEnableScreen() = 0;
154 145
155 // Shows Reset screen. 146 // Shows Reset screen.
156 virtual void ShowKioskAutolaunchScreen() = 0; 147 virtual void ShowKioskAutolaunchScreen() = 0;
157 148
158 // Show wrong hwid screen. 149 // Show wrong hwid screen.
159 virtual void ShowWrongHWIDScreen() = 0; 150 virtual void ShowWrongHWIDScreen() = 0;
160 151
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 // --------------- Account creation methods.
Nikita (slow) 2014/06/06 14:49:48 nit: should be updated
Denis Kuznetsov (DE-MUC) 2014/06/06 15:18:43 Done.
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
161 // Let the delegate know about the handler it is supposed to be using. 169 // Let the delegate know about the handler it is supposed to be using.
162 virtual void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) = 0; 170 virtual void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) = 0;
163 171
164 // Returns users list to be shown. 172 // Returns users list to be shown.
165 virtual const UserList& GetUsers() const = 0; 173 virtual const UserList& GetUsers() const = 0;
166 174
167 // Whether login as guest is available. 175 // Whether login as guest is available.
168 virtual bool IsShowGuest() const = 0; 176 virtual bool IsShowGuest() const = 0;
169 177
170 // Weather to show the user pods or only GAIA sign in. 178 // Weather to show the user pods or only GAIA sign in.
171 // Public sessions are always shown. 179 // Public sessions are always shown.
172 virtual bool IsShowUsers() const = 0; 180 virtual bool IsShowUsers() const = 0;
173 181
174 // Returns true if sign in is in progress.
175 virtual bool IsSigninInProgress() const = 0;
176
177 // Whether user sign in has completed. 182 // Whether user sign in has completed.
178 virtual bool IsUserSigninCompleted() const = 0; 183 virtual bool IsUserSigninCompleted() const = 0;
179 184
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
191 // Request to (re)load user list. 185 // Request to (re)load user list.
192 virtual void HandleGetUsers() = 0; 186 virtual void HandleGetUsers() = 0;
193 187
194 // Set authentication type (for easier unlocking). 188 // Set authentication type (for easier unlocking).
195 virtual void SetAuthType( 189 virtual void SetAuthType(
196 const std::string& username, 190 const std::string& username,
197 ScreenlockBridge::LockHandler::AuthType auth_type) = 0; 191 ScreenlockBridge::LockHandler::AuthType auth_type) = 0;
198 192
199 // Get authentication type (for easier unlocking). 193 // Get authentication type (for easier unlocking).
200 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType( 194 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType(
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; 468 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_;
475 469
476 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; 470 base::WeakPtrFactory<SigninScreenHandler> weak_factory_;
477 471
478 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); 472 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler);
479 }; 473 };
480 474
481 } // namespace chromeos 475 } // namespace chromeos
482 476
483 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ 477 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698