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

Unified 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: move user activity timer reset to WebUILoginDisplay 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/existing_user_controller.h
diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h
index 16397e6bef0abce93eb83ae35179c5f1b4dc1088..a263e889030dfd3a663fc9488820d98625277f2d 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.h
+++ b/chrome/browser/chromeos/login/existing_user_controller.h
@@ -7,6 +7,7 @@
#include <string>
+#include "ash/wm/user_activity_observer.h"
bartfab (slow) 2013/02/28 10:21:33 This is no longer used.
dconnelly 2013/02/28 12:52:56 Done.
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
@@ -67,6 +68,12 @@ class ExistingUserController : public LoginDisplay::Delegate,
// Invoked when a kiosk app launch is failed.
void OnKioskAppLaunchFailed();
+ // Start the public session auto-login timer.
+ void StartPublicSessionAutoLoginTimer();
+
+ // Stop the public session auto-login timer when a login attempt begins.
+ void StopPublicSessionAutoLoginTimer();
+
// LoginDisplay::Delegate: implementation
virtual void CancelPasswordChangedFlow() OVERRIDE;
virtual void CreateAccount() OVERRIDE;
@@ -81,9 +88,11 @@ class ExistingUserController : public LoginDisplay::Delegate,
virtual void LoginAsRetailModeUser() OVERRIDE;
virtual void LoginAsGuest() OVERRIDE;
virtual void LoginAsPublicAccount(const std::string& username) OVERRIDE;
+ virtual void OnSigninScreenReady() OVERRIDE;
virtual void OnUserSelected(const std::string& username) OVERRIDE;
virtual void OnStartEnterpriseEnrollment() OVERRIDE;
virtual void OnStartDeviceReset() OVERRIDE;
+ virtual void ResetPublicSessionAutoLoginTimer() OVERRIDE;
virtual void ResyncUserData() OVERRIDE;
virtual void SetDisplayEmail(const std::string& email) OVERRIDE;
virtual void ShowWrongHWIDScreen() OVERRIDE;
@@ -113,8 +122,15 @@ class ExistingUserController : public LoginDisplay::Delegate,
private:
friend class ExistingUserControllerTest;
+ friend class ExistingUserControllerPublicSessionTest;
friend class MockLoginPerformerDelegate;
+ // Retrieve public session auto-login policy and update the timer.
+ void ConfigurePublicSessionAutoLogin();
+
+ // Trigger public session auto-login.
+ void OnPublicSessionAutoLoginTimerFire();
+
// LoginPerformer::Delegate implementation:
virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE;
virtual void OnLoginSuccess(
@@ -195,6 +211,18 @@ class ExistingUserController : public LoginDisplay::Delegate,
// Updates the |login_display_| attached to this controller.
void UpdateLoginDisplay(const UserList& users);
+ // Accesses (and lazily constructs if necessary) the auto-login timer.
+ base::OneShotTimer<ExistingUserController>& auto_login_timer();
bartfab (slow) 2013/02/28 10:21:33 All-lowercase should be used for the simplest of g
dconnelly 2013/02/28 12:52:56 Done.
+
+ // Public session auto-login timer.
+ scoped_ptr<base::OneShotTimer<ExistingUserController> > auto_login_timer_;
+
+ // Public session auto-login timeout, in milliseconds.
+ int public_session_auto_login_delay_;
+
+ // Username for public session auto-login.
+ std::string public_session_auto_login_username_;
+
// Used to execute login operations.
scoped_ptr<LoginPerformer> login_performer_;
@@ -255,6 +283,9 @@ class ExistingUserController : public LoginDisplay::Delegate,
// session.
bool do_auto_enrollment_;
+ // Whether the sign-in UI is finished loading.
+ bool signin_screen_ready_;
+
// The username used for auto-enrollment, if it was triggered.
std::string auto_enrollment_username_;
@@ -269,6 +300,12 @@ class ExistingUserController : public LoginDisplay::Delegate,
base::OneShotTimer<ExistingUserController> reboot_timer_;
FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin);
+ FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerPublicSessionTest,
+ ConfigureAutoLogin);
+ FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerPublicSessionTest,
+ UserActivityRestartsAutoLogin);
+ FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerPublicSessionTest,
+ OnAutoLoginFire);
DISALLOW_COPY_AND_ASSIGN(ExistingUserController);
};

Powered by Google App Engine
This is Rietveld 408576698