OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/webui/chromeos/login/signin_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod); | 210 DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod); |
211 | 211 |
212 base::DictionaryValue* const users_lru_input_methods = updater.Get(); | 212 base::DictionaryValue* const users_lru_input_methods = updater.Get(); |
213 if (users_lru_input_methods != NULL) { | 213 if (users_lru_input_methods != NULL) { |
214 users_lru_input_methods->SetStringWithoutPathExpansion(username, ""); | 214 users_lru_input_methods->SetStringWithoutPathExpansion(username, ""); |
215 } | 215 } |
216 return false; | 216 return false; |
217 } | 217 } |
218 | 218 |
219 if (!Contains(manager->GetActiveInputMethodIds(), input_method)) { | 219 if (!Contains(manager->GetActiveIMEState()->GetActiveInputMethodIds(), |
220 if (!manager->EnableInputMethod(input_method)) { | 220 input_method)) { |
| 221 if (!manager->GetActiveIMEState()->EnableInputMethod(input_method)) { |
221 DLOG(ERROR) << "SigninScreenHandler::SetUserInputMethod('" << username | 222 DLOG(ERROR) << "SigninScreenHandler::SetUserInputMethod('" << username |
222 << "'): user input method '" << input_method | 223 << "'): user input method '" << input_method |
223 << "' is not enabled and enabling failed (ignored!)."; | 224 << "' is not enabled and enabling failed (ignored!)."; |
224 } | 225 } |
225 } | 226 } |
226 manager->ChangeInputMethod(input_method); | 227 manager->GetActiveIMEState()->ChangeInputMethod(input_method, |
| 228 false /* show_message */); |
227 | 229 |
228 return true; | 230 return true; |
229 } | 231 } |
230 | 232 |
231 } // namespace | 233 } // namespace |
232 | 234 |
233 // LoginScreenContext implementation ------------------------------------------ | 235 // LoginScreenContext implementation ------------------------------------------ |
234 | 236 |
235 LoginScreenContext::LoginScreenContext() { | 237 LoginScreenContext::LoginScreenContext() { |
236 Init(); | 238 Init(); |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 | 1013 |
1012 const bool succeed = SetUserInputMethodImpl(username, manager); | 1014 const bool succeed = SetUserInputMethodImpl(username, manager); |
1013 | 1015 |
1014 // This is also a case when LRU layout is set only for a few local users, | 1016 // This is also a case when LRU layout is set only for a few local users, |
1015 // thus others need to be switched to default locale. | 1017 // thus others need to be switched to default locale. |
1016 // Otherwise they will end up using another user's locale to log in. | 1018 // Otherwise they will end up using another user's locale to log in. |
1017 if (!succeed) { | 1019 if (!succeed) { |
1018 DVLOG(0) << "SetUserInputMethod('" << username | 1020 DVLOG(0) << "SetUserInputMethod('" << username |
1019 << "'): failed to set user layout. Switching to default."; | 1021 << "'): failed to set user layout. Switching to default."; |
1020 | 1022 |
1021 manager->SetInputMethodLoginDefault(); | 1023 manager->GetActiveIMEState()->SetInputMethodLoginDefault(); |
1022 } | 1024 } |
1023 } | 1025 } |
1024 | 1026 |
1025 | 1027 |
1026 void SigninScreenHandler::UserSettingsChanged() { | 1028 void SigninScreenHandler::UserSettingsChanged() { |
1027 DCHECK(gaia_screen_handler_); | 1029 DCHECK(gaia_screen_handler_); |
1028 GaiaContext context; | 1030 GaiaContext context; |
1029 if (delegate_) | 1031 if (delegate_) |
1030 context.has_users = !delegate_->GetUsers().empty(); | 1032 context.has_users = !delegate_->GetUsers().empty(); |
1031 gaia_screen_handler_->UpdateGaia(context); | 1033 gaia_screen_handler_->UpdateGaia(context); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 return gaia_screen_handler_->frame_error(); | 1493 return gaia_screen_handler_->frame_error(); |
1492 } | 1494 } |
1493 | 1495 |
1494 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1496 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
1495 caps_lock_enabled_ = enabled; | 1497 caps_lock_enabled_ = enabled; |
1496 if (page_is_ready()) | 1498 if (page_is_ready()) |
1497 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1499 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
1498 } | 1500 } |
1499 | 1501 |
1500 } // namespace chromeos | 1502 } // namespace chromeos |
OLD | NEW |