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

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: reset timer on user activity, review comments 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 73e5f0db2d94cfb3e2dbc6a4f784aa0c62732848..63ba211b8f0ccf4dea3146a0b80cbbe61e4fc000 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"
@@ -42,7 +43,8 @@ class ExistingUserController : public LoginDisplay::Delegate,
public content::NotificationObserver,
public LoginPerformer::Delegate,
public LoginUtils::Delegate,
- public PasswordChangedView::Delegate {
+ public PasswordChangedView::Delegate,
+ public ash::UserActivityObserver {
public:
// All UI initialization is deferred till Init() call.
explicit ExistingUserController(LoginDisplayHost* host);
@@ -63,6 +65,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 overrides:
bartfab (slow) 2013/02/11 17:11:21 nit: s/overrides/implementation/ or s/overrides//
dconnelly 2013/02/11 17:21:41 Done.
+ virtual void OnUserActivity() OVERRIDE;
+
// LoginDisplay::Delegate: implementation
virtual void CancelPasswordChangedFlow() OVERRIDE;
virtual void CreateAccount() OVERRIDE;
@@ -77,6 +88,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;
@@ -110,6 +122,9 @@ class ExistingUserController : public LoginDisplay::Delegate,
friend class ExistingUserControllerTest;
friend class MockLoginPerformerDelegate;
+ // Retrieve public session auto-login policy and update the timer.
+ void ConfigurePublicSessionAutoLogin();
+
// LoginPerformer::Delegate implementation:
virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE;
virtual void OnLoginSuccess(
@@ -194,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_;
+
+ // Public session auto-login timeout, in milliseconds.
+ int public_session_auto_login_timer_;
bartfab (slow) 2013/02/11 17:11:21 nit: Calling this "timer" is not really accurate.
dconnelly 2013/02/11 17:21:41 Done.
+
+ // Username for public session auto-login.
+ std::string public_session_auto_login_username_;
bartfab (slow) 2013/02/11 17:11:21 I think in the case of device local accounts (aka
+
// Used to execute login operations.
scoped_ptr<LoginPerformer> login_performer_;
@@ -257,6 +281,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_;

Powered by Google App Engine
This is Rietveld 408576698