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..3372ad79c0c39d4c9479d0ab1dc7812ed2a485b0 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 kPasswordClearTimeoutS = 60; |
ygorshenin1
2013/02/26 16:43:01
nit: s/kPasswordClearTimeoutS/kPasswordClearTimeou
dzhioev (left Google)
2013/02/26 17:02:40
Done.
|
+ |
+} |
+ |
// 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,25 @@ void WebUILoginDisplay::Signout() { |
delegate_->Signout(); |
} |
+void WebUILoginDisplay::OnUserActivity() { |
+ LOG(ERROR) << "User activity"; |
ygorshenin1
2013/02/26 16:43:01
Why do we need this log message?
dzhioev (left Google)
2013/02/26 17:02:40
Just forgot to remove.
Done.
|
+ if (!password_clear_timer_.IsRunning()) { |
ygorshenin1
2013/02/26 16:43:01
nit: you can avoid curly braces there.
dzhioev (left Google)
2013/02/26 17:02:40
Done.
|
+ StartPasswordClearTimer(); |
+ } |
+ password_clear_timer_.Reset(); |
+} |
+ |
+void WebUILoginDisplay::StartPasswordClearTimer() { |
+ DCHECK(!password_clear_timer_.IsRunning()); |
+ password_clear_timer_.Start(FROM_HERE, |
+ base::TimeDelta::FromSeconds(kPasswordClearTimeoutS), this, |
+ &WebUILoginDisplay::OnPasswordClearTimerExpired); |
+} |
+ |
+void WebUILoginDisplay::OnPasswordClearTimerExpired() { |
+ LOG(ERROR) << "Password timer expired"; |
ygorshenin1
2013/02/26 16:43:01
Suggest to change log level from ERROR to WARNING.
dzhioev (left Google)
2013/02/26 17:02:40
I've forgot to remove it too.
|
+ if (webui_handler_) |
+ webui_handler_->ClearUserPodPassword(); |
+} |
+ |
} // namespace chromeos |