| 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" | 8 #include "ash/wm/user_activity_detector.h" |
| 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 10 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 10 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 11 #include "chrome/browser/chromeos/login/screen_locker.h" | 11 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 12 #include "chrome/browser/chromeos/login/user_adding_screen.h" | 12 #include "chrome/browser/chromeos/login/user_adding_screen.h" |
| 13 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 13 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 14 #include "chrome/browser/chromeos/login/webui_login_view.h" | 14 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 17 #include "chromeos/ime/input_method_manager.h" | 17 #include "chromeos/ime/input_method_manager.h" |
| 18 #include "chromeos/ime/xkeyboard.h" | 18 #include "chromeos/ime/keyboard_controller.h" |
| 19 #include "grit/chromium_strings.h" | 19 #include "grit/chromium_strings.h" |
| 20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.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; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } | 188 } |
| 189 | 189 |
| 190 // Only display hints about keyboard layout if the error is authentication- | 190 // Only display hints about keyboard layout if the error is authentication- |
| 191 // related. | 191 // related. |
| 192 if (error_msg_id != IDS_LOGIN_ERROR_WHITELIST && | 192 if (error_msg_id != IDS_LOGIN_ERROR_WHITELIST && |
| 193 error_msg_id != IDS_LOGIN_ERROR_OWNER_KEY_LOST && | 193 error_msg_id != IDS_LOGIN_ERROR_OWNER_KEY_LOST && |
| 194 error_msg_id != IDS_LOGIN_ERROR_OWNER_REQUIRED) { | 194 error_msg_id != IDS_LOGIN_ERROR_OWNER_REQUIRED) { |
| 195 // Display a warning if Caps Lock is on. | 195 // Display a warning if Caps Lock is on. |
| 196 input_method::InputMethodManager* ime_manager = | 196 input_method::InputMethodManager* ime_manager = |
| 197 input_method::InputMethodManager::Get(); | 197 input_method::InputMethodManager::Get(); |
| 198 if (ime_manager->GetXKeyboard()->CapsLockIsEnabled()) { | 198 if (ime_manager->GetKeyboardController()->CapsLockIsEnabled()) { |
| 199 // TODO(ivankr): use a format string instead of concatenation. | 199 // TODO(ivankr): use a format string instead of concatenation. |
| 200 error_text += "\n" + | 200 error_text += "\n" + |
| 201 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_CAPS_LOCK_HINT); | 201 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_CAPS_LOCK_HINT); |
| 202 } | 202 } |
| 203 | 203 |
| 204 // Display a hint to switch keyboards if there are other active input | 204 // Display a hint to switch keyboards if there are other active input |
| 205 // methods. | 205 // methods. |
| 206 if (ime_manager->GetNumActiveInputMethods() > 1) { | 206 if (ime_manager->GetNumActiveInputMethods() > 1) { |
| 207 error_text += "\n" + | 207 error_text += "\n" + |
| 208 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_KEYBOARD_SWITCH_HINT); | 208 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_KEYBOARD_SWITCH_HINT); |
| (...skipping 211 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 |