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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.h

Issue 12218078: Implement a policy to autologin a public account. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last upload failed Created 7 years, 10 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) 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_EXISTING_USER_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Creates and shows login UI for known users. 56 // Creates and shows login UI for known users.
57 void Init(const UserList& users); 57 void Init(const UserList& users);
58 58
59 // Tells the controller to enter the Enterprise Enrollment screen when 59 // Tells the controller to enter the Enterprise Enrollment screen when
60 // appropriate. 60 // appropriate.
61 void DoAutoEnrollment(); 61 void DoAutoEnrollment();
62 62
63 // Tells the controller to resume a pending login. 63 // Tells the controller to resume a pending login.
64 void ResumeLogin(); 64 void ResumeLogin();
65 65
66 // Start the public account auto-login timer.
bartfab (slow) 2013/02/11 09:46:01 Nit: s/public account/public session/ (here and el
Nikita (slow) 2013/02/11 09:56:58 nit: General comment about naming of these two met
dconnelly 2013/02/11 16:17:56 Done.
dconnelly 2013/02/11 16:17:56 Done.
67 void StartAutoLoginTimer();
68
69 // Stop the public account auto-login timer when a login attempt begins.
70 void StopAutoLoginTimer();
71
66 // LoginDisplay::Delegate: implementation 72 // LoginDisplay::Delegate: implementation
67 virtual void CancelPasswordChangedFlow() OVERRIDE; 73 virtual void CancelPasswordChangedFlow() OVERRIDE;
68 virtual void CreateAccount() OVERRIDE; 74 virtual void CreateAccount() OVERRIDE;
69 virtual void CreateLocallyManagedUser(const string16& display_name, 75 virtual void CreateLocallyManagedUser(const string16& display_name,
70 const std::string& password) OVERRIDE; 76 const std::string& password) OVERRIDE;
71 virtual void CompleteLogin(const std::string& username, 77 virtual void CompleteLogin(const std::string& username,
72 const std::string& password) OVERRIDE; 78 const std::string& password) OVERRIDE;
73 virtual string16 GetConnectedNetworkName() OVERRIDE; 79 virtual string16 GetConnectedNetworkName() OVERRIDE;
74 virtual void Login(const std::string& username, 80 virtual void Login(const std::string& username,
75 const std::string& password) OVERRIDE; 81 const std::string& password) OVERRIDE;
76 virtual void MigrateUserData(const std::string& old_password) OVERRIDE; 82 virtual void MigrateUserData(const std::string& old_password) OVERRIDE;
77 virtual void LoginAsRetailModeUser() OVERRIDE; 83 virtual void LoginAsRetailModeUser() OVERRIDE;
78 virtual void LoginAsGuest() OVERRIDE; 84 virtual void LoginAsGuest() OVERRIDE;
79 virtual void LoginAsPublicAccount(const std::string& username) OVERRIDE; 85 virtual void LoginAsPublicAccount(const std::string& username) OVERRIDE;
86 virtual void OnSigninScreenReady() OVERRIDE;
80 virtual void OnUserSelected(const std::string& username) OVERRIDE; 87 virtual void OnUserSelected(const std::string& username) OVERRIDE;
81 virtual void OnStartEnterpriseEnrollment() OVERRIDE; 88 virtual void OnStartEnterpriseEnrollment() OVERRIDE;
82 virtual void OnStartDeviceReset() OVERRIDE; 89 virtual void OnStartDeviceReset() OVERRIDE;
83 virtual void ResyncUserData() OVERRIDE; 90 virtual void ResyncUserData() OVERRIDE;
84 virtual void SetDisplayEmail(const std::string& email) OVERRIDE; 91 virtual void SetDisplayEmail(const std::string& email) OVERRIDE;
85 virtual void Signout() OVERRIDE; 92 virtual void Signout() OVERRIDE;
86 93
87 // content::NotificationObserver implementation. 94 // content::NotificationObserver implementation.
88 virtual void Observe(int type, 95 virtual void Observe(int type,
89 const content::NotificationSource& source, 96 const content::NotificationSource& source,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 std::string password, 194 std::string password,
188 LoginPerformer::AuthorizationMode auth_mode); 195 LoginPerformer::AuthorizationMode auth_mode);
189 196
190 void set_login_performer_delegate(LoginPerformer::Delegate* d) { 197 void set_login_performer_delegate(LoginPerformer::Delegate* d) {
191 login_performer_delegate_.reset(d); 198 login_performer_delegate_.reset(d);
192 } 199 }
193 200
194 // Updates the |login_display_| attached to this controller. 201 // Updates the |login_display_| attached to this controller.
195 void UpdateLoginDisplay(const UserList& users); 202 void UpdateLoginDisplay(const UserList& users);
196 203
204 // Public account auto-login timer.
205 base::OneShotTimer<ExistingUserController> auto_login_timer_;
206
197 // Used to execute login operations. 207 // Used to execute login operations.
198 scoped_ptr<LoginPerformer> login_performer_; 208 scoped_ptr<LoginPerformer> login_performer_;
199 209
200 // Delegate for login performer to be overridden by tests. 210 // Delegate for login performer to be overridden by tests.
201 // |this| is used if |login_performer_delegate_| is NULL. 211 // |this| is used if |login_performer_delegate_| is NULL.
202 scoped_ptr<LoginPerformer::Delegate> login_performer_delegate_; 212 scoped_ptr<LoginPerformer::Delegate> login_performer_delegate_;
203 213
204 // Delegate to forward all login status events to. 214 // Delegate to forward all login status events to.
205 // Tests can use this to receive login status events. 215 // Tests can use this to receive login status events.
206 LoginStatusConsumer* login_status_consumer_; 216 LoginStatusConsumer* login_status_consumer_;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 std::string online_succeeded_for_; 260 std::string online_succeeded_for_;
251 261
252 // True if password has been changed for user who is completing sign in. 262 // True if password has been changed for user who is completing sign in.
253 // Set in OnLoginSuccess. Before that use LoginPerformer::password_changed(). 263 // Set in OnLoginSuccess. Before that use LoginPerformer::password_changed().
254 bool password_changed_; 264 bool password_changed_;
255 265
256 // True if auto-enrollment should be performed before starting the user's 266 // True if auto-enrollment should be performed before starting the user's
257 // session. 267 // session.
258 bool do_auto_enrollment_; 268 bool do_auto_enrollment_;
259 269
270 // Whether the sign-in UI is finished loading.
271 bool signin_screen_ready_;
272
260 // The username used for auto-enrollment, if it was triggered. 273 // The username used for auto-enrollment, if it was triggered.
261 std::string auto_enrollment_username_; 274 std::string auto_enrollment_username_;
262 275
263 // Callback to invoke to resume login, after auto-enrollment has completed. 276 // Callback to invoke to resume login, after auto-enrollment has completed.
264 base::Closure resume_login_callback_; 277 base::Closure resume_login_callback_;
265 278
266 // Time when the signin screen was first displayed. Used to measure the time 279 // Time when the signin screen was first displayed. Used to measure the time
267 // from showing the screen until a successful login is performed. 280 // from showing the screen until a successful login is performed.
268 base::Time time_init_; 281 base::Time time_init_;
269 282
270 // Timer for the interval to wait for the reboot after TPM error UI was shown. 283 // Timer for the interval to wait for the reboot after TPM error UI was shown.
271 base::OneShotTimer<ExistingUserController> reboot_timer_; 284 base::OneShotTimer<ExistingUserController> reboot_timer_;
272 285
273 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); 286 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin);
274 287
275 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); 288 DISALLOW_COPY_AND_ASSIGN(ExistingUserController);
276 }; 289 };
277 290
278 } // namespace chromeos 291 } // namespace chromeos
279 292
280 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ 293 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698