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 "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 8 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
9 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 9 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
10 #include "chrome/browser/chromeos/login/screen_locker.h" | 10 #include "chrome/browser/chromeos/login/screen_locker.h" |
11 #include "chrome/browser/chromeos/login/user_adding_screen.h" | 11 #include "chrome/browser/chromeos/login/user_adding_screen.h" |
12 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 12 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
13 #include "chrome/browser/chromeos/login/webui_login_view.h" | 13 #include "chrome/browser/chromeos/login/webui_login_view.h" |
14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chromeos/ime/ime_keyboard.h" |
16 #include "chromeos/ime/input_method_manager.h" | 17 #include "chromeos/ime/input_method_manager.h" |
17 #include "chromeos/ime/xkeyboard.h" | |
18 #include "grit/chromium_strings.h" | 18 #include "grit/chromium_strings.h" |
19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
22 #include "ui/wm/core/user_activity_detector.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 |
(...skipping 160 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->GetImeKeyboard()->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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this, | 425 base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this, |
426 &WebUILoginDisplay::OnPasswordClearTimerExpired); | 426 &WebUILoginDisplay::OnPasswordClearTimerExpired); |
427 } | 427 } |
428 | 428 |
429 void WebUILoginDisplay::OnPasswordClearTimerExpired() { | 429 void WebUILoginDisplay::OnPasswordClearTimerExpired() { |
430 if (webui_handler_) | 430 if (webui_handler_) |
431 webui_handler_->ClearUserPodPassword(); | 431 webui_handler_->ClearUserPodPassword(); |
432 } | 432 } |
433 | 433 |
434 } // namespace chromeos | 434 } // namespace chromeos |
OLD | NEW |