| 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..14ccde8dde24d3adceb36d614a1157242668b8cc 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,12 @@ 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();
|
| +
|
| // LoginDisplay::Delegate: implementation
|
| virtual void CancelPasswordChangedFlow() OVERRIDE;
|
| virtual void CreateAccount() OVERRIDE;
|
| @@ -75,6 +83,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 +116,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(
|
| @@ -126,6 +142,9 @@ class ExistingUserController : public LoginDisplay::Delegate,
|
| // LoginUtils::Delegate implementation:
|
| virtual void OnProfilePrepared(Profile* profile) OVERRIDE;
|
|
|
| + // UserActivityObserver::Observer implementation.
|
| + virtual void OnUserActivity() OVERRIDE;
|
| +
|
| // Starts WizardController with the specified screen.
|
| void ActivateWizard(const std::string& screen_name);
|
|
|
| @@ -189,6 +208,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();
|
| +
|
| + // 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_;
|
|
|
| @@ -249,6 +280,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 +297,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);
|
| };
|
|
|