OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/input_method/input_method_manager.h" |
7 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 8 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
8 #include "chrome/browser/chromeos/login/webui_login_view.h" | 9 #include "chrome/browser/chromeos/login/webui_login_view.h" |
9 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 10 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
11 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
12 #include "grit/chromium_strings.h" | 13 #include "grit/chromium_strings.h" |
13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
14 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
15 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
16 | 17 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 case IDS_LOGIN_ERROR_CAPTIVE_PORTAL: | 106 case IDS_LOGIN_ERROR_CAPTIVE_PORTAL: |
106 error_text = l10n_util::GetStringFUTF8( | 107 error_text = l10n_util::GetStringFUTF8( |
107 error_msg_id, delegate()->GetConnectedNetworkName()); | 108 error_msg_id, delegate()->GetConnectedNetworkName()); |
108 break; | 109 break; |
109 default: | 110 default: |
110 error_text = l10n_util::GetStringUTF8(error_msg_id); | 111 error_text = l10n_util::GetStringUTF8(error_msg_id); |
111 break; | 112 break; |
112 } | 113 } |
113 | 114 |
114 // Display a warning if Caps Lock is on and error is authentication-related. | 115 // Display a warning if Caps Lock is on and error is authentication-related. |
115 if (input_method::XKeyboard::CapsLockIsEnabled() && | 116 input_method::InputMethodManager* ime_manager = |
| 117 input_method::InputMethodManager::GetInstance(); |
| 118 if (ime_manager->GetXKeyboard()->CapsLockIsEnabled() && |
116 error_msg_id != IDS_LOGIN_ERROR_WHITELIST) { | 119 error_msg_id != IDS_LOGIN_ERROR_WHITELIST) { |
117 // TODO(ivankr): use a format string instead of concatenation. | 120 // TODO(ivankr): use a format string instead of concatenation. |
118 error_text += "\n" + | 121 error_text += "\n" + |
119 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_CAPS_LOCK_HINT); | 122 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_CAPS_LOCK_HINT); |
120 } | 123 } |
121 | 124 |
122 std::string help_link; | 125 std::string help_link; |
123 switch (error_msg_id) { | 126 switch (error_msg_id) { |
124 case IDS_LOGIN_ERROR_CAPTIVE_PORTAL: | 127 case IDS_LOGIN_ERROR_CAPTIVE_PORTAL: |
125 help_link = l10n_util::GetStringUTF8(IDS_LOGIN_FIX_CAPTIVE_PORTAL); | 128 help_link = l10n_util::GetStringUTF8(IDS_LOGIN_FIX_CAPTIVE_PORTAL); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 bool WebUILoginDisplay::IsShowNewUser() const { | 214 bool WebUILoginDisplay::IsShowNewUser() const { |
212 return show_new_user_; | 215 return show_new_user_; |
213 } | 216 } |
214 | 217 |
215 void WebUILoginDisplay::SetDisplayEmail(const std::string& email) { | 218 void WebUILoginDisplay::SetDisplayEmail(const std::string& email) { |
216 if (delegate_) | 219 if (delegate_) |
217 delegate_->SetDisplayEmail(email); | 220 delegate_->SetDisplayEmail(email); |
218 } | 221 } |
219 | 222 |
220 } // namespace chromeos | 223 } // namespace chromeos |
OLD | NEW |