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 1de2597abf29d124001ea68b7bb7f569ccf86b05..e867977fc883f2f60e6004edf354e6cd83551d95 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" |
#include "base/callback_forward.h" |
#include "base/compiler_specific.h" |
#include "base/gtest_prod_util.h" |
@@ -40,7 +41,8 @@ class LoginDisplayHost; |
class ExistingUserController : public LoginDisplay::Delegate, |
public content::NotificationObserver, |
public LoginPerformer::Delegate, |
- public LoginUtils::Delegate { |
+ public LoginUtils::Delegate, |
+ public ash::UserActivityObserver { |
public: |
// All UI initialization is deferred till Init() call. |
explicit ExistingUserController(LoginDisplayHost* host); |
@@ -61,6 +63,15 @@ class ExistingUserController : public LoginDisplay::Delegate, |
// Tells the controller to resume a pending login. |
void ResumeLogin(); |
+ // Start the public session auto-login timer. |
+ void StartPublicSessionAutoLoginTimer(); |
+ |
+ // Stop the public session auto-login timer when a login attempt begins. |
+ void StopPublicSessionAutoLoginTimer(); |
+ |
+ // UserActivityObserver::Observer implementation. |
bartfab (slow)
2013/02/25 16:51:23
The overrides should follow the order in which the
dconnelly
2013/02/26 18:04:15
Done.
|
+ virtual void OnUserActivity() OVERRIDE; |
+ |
// LoginDisplay::Delegate: implementation |
virtual void CancelPasswordChangedFlow() OVERRIDE; |
virtual void CreateAccount() OVERRIDE; |
@@ -75,6 +86,7 @@ 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; |
@@ -107,8 +119,16 @@ class ExistingUserController : public LoginDisplay::Delegate, |
private: |
friend class ExistingUserControllerTest; |
+ friend class ExistingUserControllerAutoLoginUnitTests; |
+ friend class ExistingUserControllerAutoLoginIntegrationTests; |
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( |
@@ -189,6 +209,15 @@ class ExistingUserController : public LoginDisplay::Delegate, |
// Updates the |login_display_| attached to this controller. |
void UpdateLoginDisplay(const UserList& users); |
+ // Public session auto-login timer. |
+ base::OneShotTimer<ExistingUserController> auto_login_timer_; |
bartfab (slow)
2013/02/25 16:51:23
When I was adding the session length limiter, ther
dconnelly
2013/02/26 18:04:15
Done.
|
+ |
+ // 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_; |
@@ -249,6 +278,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_; |
@@ -263,6 +295,10 @@ class ExistingUserController : public LoginDisplay::Delegate, |
base::OneShotTimer<ExistingUserController> reboot_timer_; |
FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); |
+ FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerPublicSessionTest, |
bartfab (slow)
2013/02/25 16:51:23
Since you already added the base classes of your t
dconnelly
2013/02/26 18:04:15
I tried that, it doesn't work. From https://code.
bartfab (slow)
2013/02/28 10:21:33
Yes. You need to implement the accesses to the Exi
|
+ ConfigureAutoLogin); |
+ FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerPublicSessionTest, |
+ OnAutoLoginFire); |
DISALLOW_COPY_AND_ASSIGN(ExistingUserController); |
}; |