| Index: chrome/browser/chromeos/login/webui_login_display.cc
|
| diff --git a/chrome/browser/chromeos/login/webui_login_display.cc b/chrome/browser/chromeos/login/webui_login_display.cc
|
| index 1931c5dde30e2bdf1ca03667ac154bb5e5364c4a..e8a019d433d89416dbc3938530ac0567cea286bb 100644
|
| --- a/chrome/browser/chromeos/login/webui_login_display.cc
|
| +++ b/chrome/browser/chromeos/login/webui_login_display.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "chrome/browser/chromeos/login/webui_login_display.h"
|
|
|
| +#include "ash/wm/user_activity_detector.h"
|
| #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
|
| #include "chrome/browser/chromeos/input_method/input_method_configuration.h"
|
| #include "chrome/browser/chromeos/input_method/input_method_manager.h"
|
| @@ -21,11 +22,21 @@
|
|
|
| namespace chromeos {
|
|
|
| +namespace {
|
| +
|
| +const int kPasswordClearTimeoutSec = 60;
|
| +
|
| +}
|
| +
|
| // WebUILoginDisplay, public: --------------------------------------------------
|
|
|
| WebUILoginDisplay::~WebUILoginDisplay() {
|
| if (webui_handler_)
|
| webui_handler_->ResetSigninScreenHandlerDelegate();
|
| + ash::UserActivityDetector* activity_detector = ash::Shell::GetInstance()->
|
| + user_activity_detector();
|
| + if (activity_detector->HasObserver(this))
|
| + activity_detector->RemoveObserver(this);
|
| }
|
|
|
| // LoginDisplay implementation: ------------------------------------------------
|
| @@ -48,6 +59,11 @@ void WebUILoginDisplay::Init(const UserList& users,
|
| show_guest_ = show_guest;
|
| show_users_ = show_users;
|
| show_new_user_ = show_new_user;
|
| +
|
| + ash::UserActivityDetector* activity_detector = ash::Shell::GetInstance()->
|
| + user_activity_detector();
|
| + if (!activity_detector->HasObserver(this))
|
| + activity_detector->AddObserver(this);
|
| }
|
|
|
| void WebUILoginDisplay::OnPreferencesChanged() {
|
| @@ -319,4 +335,22 @@ void WebUILoginDisplay::Signout() {
|
| delegate_->Signout();
|
| }
|
|
|
| +void WebUILoginDisplay::OnUserActivity() {
|
| + if (!password_clear_timer_.IsRunning())
|
| + StartPasswordClearTimer();
|
| + password_clear_timer_.Reset();
|
| +}
|
| +
|
| +void WebUILoginDisplay::StartPasswordClearTimer() {
|
| + DCHECK(!password_clear_timer_.IsRunning());
|
| + password_clear_timer_.Start(FROM_HERE,
|
| + base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this,
|
| + &WebUILoginDisplay::OnPasswordClearTimerExpired);
|
| +}
|
| +
|
| +void WebUILoginDisplay::OnPasswordClearTimerExpired() {
|
| + if (webui_handler_)
|
| + webui_handler_->ClearUserPodPassword();
|
| +}
|
| +
|
| } // namespace chromeos
|
|
|