| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/webui_login_display.h" | 5 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/user_activity_detector.h" | |
| 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 8 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 10 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 9 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 11 #include "chrome/browser/chromeos/login/screen_locker.h" | 10 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 12 #include "chrome/browser/chromeos/login/user_adding_screen.h" | 11 #include "chrome/browser/chromeos/login/user_adding_screen.h" |
| 13 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 12 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 14 #include "chrome/browser/chromeos/login/webui_login_view.h" | 13 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 17 #include "chromeos/ime/input_method_manager.h" | 16 #include "chromeos/ime/input_method_manager.h" |
| 18 #include "chromeos/ime/xkeyboard.h" | 17 #include "chromeos/ime/xkeyboard.h" |
| 19 #include "grit/chromium_strings.h" | 18 #include "grit/chromium_strings.h" |
| 20 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
| 22 #include "ui/wm/core/user_activity_detector.h" |
| 23 | 23 |
| 24 namespace chromeos { | 24 namespace chromeos { |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 const int kPasswordClearTimeoutSec = 60; | 28 const int kPasswordClearTimeoutSec = 60; |
| 29 | 29 |
| 30 } | 30 } |
| 31 | 31 |
| 32 // WebUILoginDisplay, public: -------------------------------------------------- | 32 // WebUILoginDisplay, public: -------------------------------------------------- |
| 33 | 33 |
| 34 WebUILoginDisplay::~WebUILoginDisplay() { | 34 WebUILoginDisplay::~WebUILoginDisplay() { |
| 35 if (webui_handler_) | 35 if (webui_handler_) |
| 36 webui_handler_->ResetSigninScreenHandlerDelegate(); | 36 webui_handler_->ResetSigninScreenHandlerDelegate(); |
| 37 ash::UserActivityDetector* activity_detector = ash::Shell::GetInstance()-> | 37 wm::UserActivityDetector* activity_detector = ash::Shell::GetInstance()-> |
| 38 user_activity_detector(); | 38 user_activity_detector(); |
| 39 if (activity_detector->HasObserver(this)) | 39 if (activity_detector->HasObserver(this)) |
| 40 activity_detector->RemoveObserver(this); | 40 activity_detector->RemoveObserver(this); |
| 41 } | 41 } |
| 42 | 42 |
| 43 // LoginDisplay implementation: ------------------------------------------------ | 43 // LoginDisplay implementation: ------------------------------------------------ |
| 44 | 44 |
| 45 WebUILoginDisplay::WebUILoginDisplay(LoginDisplay::Delegate* delegate) | 45 WebUILoginDisplay::WebUILoginDisplay(LoginDisplay::Delegate* delegate) |
| 46 : LoginDisplay(delegate, gfx::Rect()), | 46 : LoginDisplay(delegate, gfx::Rect()), |
| 47 show_guest_(false), | 47 show_guest_(false), |
| (...skipping 11 matching lines...) Expand all Loading... |
| 59 bool show_users, | 59 bool show_users, |
| 60 bool show_new_user) { | 60 bool show_new_user) { |
| 61 // Testing that the delegate has been set. | 61 // Testing that the delegate has been set. |
| 62 DCHECK(delegate_); | 62 DCHECK(delegate_); |
| 63 | 63 |
| 64 users_ = users; | 64 users_ = users; |
| 65 show_guest_ = show_guest; | 65 show_guest_ = show_guest; |
| 66 show_users_ = show_users; | 66 show_users_ = show_users; |
| 67 show_new_user_ = show_new_user; | 67 show_new_user_ = show_new_user; |
| 68 | 68 |
| 69 ash::UserActivityDetector* activity_detector = ash::Shell::GetInstance()-> | 69 wm::UserActivityDetector* activity_detector = ash::Shell::GetInstance()-> |
| 70 user_activity_detector(); | 70 user_activity_detector(); |
| 71 if (!activity_detector->HasObserver(this)) | 71 if (!activity_detector->HasObserver(this)) |
| 72 activity_detector->AddObserver(this); | 72 activity_detector->AddObserver(this); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void WebUILoginDisplay::OnPreferencesChanged() { | 75 void WebUILoginDisplay::OnPreferencesChanged() { |
| 76 if (webui_handler_) | 76 if (webui_handler_) |
| 77 webui_handler_->OnPreferencesChanged(); | 77 webui_handler_->OnPreferencesChanged(); |
| 78 } | 78 } |
| 79 | 79 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this, | 420 base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this, |
| 421 &WebUILoginDisplay::OnPasswordClearTimerExpired); | 421 &WebUILoginDisplay::OnPasswordClearTimerExpired); |
| 422 } | 422 } |
| 423 | 423 |
| 424 void WebUILoginDisplay::OnPasswordClearTimerExpired() { | 424 void WebUILoginDisplay::OnPasswordClearTimerExpired() { |
| 425 if (webui_handler_) | 425 if (webui_handler_) |
| 426 webui_handler_->ClearUserPodPassword(); | 426 webui_handler_->ClearUserPodPassword(); |
| 427 } | 427 } |
| 428 | 428 |
| 429 } // namespace chromeos | 429 } // namespace chromeos |
| OLD | NEW |