Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1202)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test fixed. Re-sorted methods of StateImpl and IMM. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod); 208 DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod);
209 209
210 base::DictionaryValue* const users_lru_input_methods = updater.Get(); 210 base::DictionaryValue* const users_lru_input_methods = updater.Get();
211 if (users_lru_input_methods != NULL) { 211 if (users_lru_input_methods != NULL) {
212 users_lru_input_methods->SetStringWithoutPathExpansion(username, ""); 212 users_lru_input_methods->SetStringWithoutPathExpansion(username, "");
213 } 213 }
214 return false; 214 return false;
215 } 215 }
216 216
217 if (!Contains(manager->GetActiveInputMethodIds(), input_method)) { 217 if (!Contains(manager->GetActiveIMEState()->GetActiveInputMethodIds(),
218 if (!manager->EnableInputMethod(input_method)) { 218 input_method)) {
219 if (!manager->GetActiveIMEState()->EnableInputMethod(input_method)) {
219 DLOG(ERROR) << "SigninScreenHandler::SetUserInputMethod('" << username 220 DLOG(ERROR) << "SigninScreenHandler::SetUserInputMethod('" << username
220 << "'): user input method '" << input_method 221 << "'): user input method '" << input_method
221 << "' is not enabled and enabling failed (ignored!)."; 222 << "' is not enabled and enabling failed (ignored!).";
222 } 223 }
223 } 224 }
224 manager->ChangeInputMethod(input_method); 225 manager->GetActiveIMEState()->ChangeInputMethod(input_method,
226 false /* show_message */);
225 227
226 return true; 228 return true;
227 } 229 }
228 230
229 } // namespace 231 } // namespace
230 232
231 // LoginScreenContext implementation ------------------------------------------ 233 // LoginScreenContext implementation ------------------------------------------
232 234
233 LoginScreenContext::LoginScreenContext() { 235 LoginScreenContext::LoginScreenContext() {
234 Init(); 236 Init();
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 990
989 const bool succeed = SetUserInputMethodImpl(username, manager); 991 const bool succeed = SetUserInputMethodImpl(username, manager);
990 992
991 // This is also a case when LRU layout is set only for a few local users, 993 // This is also a case when LRU layout is set only for a few local users,
992 // thus others need to be switched to default locale. 994 // thus others need to be switched to default locale.
993 // Otherwise they will end up using another user's locale to log in. 995 // Otherwise they will end up using another user's locale to log in.
994 if (!succeed) { 996 if (!succeed) {
995 DVLOG(0) << "SetUserInputMethod('" << username 997 DVLOG(0) << "SetUserInputMethod('" << username
996 << "'): failed to set user layout. Switching to default."; 998 << "'): failed to set user layout. Switching to default.";
997 999
998 manager->SetInputMethodLoginDefault(); 1000 manager->GetActiveIMEState()->SetInputMethodLoginDefault();
999 } 1001 }
1000 } 1002 }
1001 1003
1002 1004
1003 void SigninScreenHandler::UserSettingsChanged() { 1005 void SigninScreenHandler::UserSettingsChanged() {
1004 DCHECK(gaia_screen_handler_); 1006 DCHECK(gaia_screen_handler_);
1005 GaiaContext context; 1007 GaiaContext context;
1006 if (delegate_) 1008 if (delegate_)
1007 context.has_users = !delegate_->GetUsers().empty(); 1009 context.has_users = !delegate_->GetUsers().empty();
1008 gaia_screen_handler_->UpdateGaia(context); 1010 gaia_screen_handler_->UpdateGaia(context);
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 return gaia_screen_handler_->frame_error(); 1474 return gaia_screen_handler_->frame_error();
1473 } 1475 }
1474 1476
1475 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { 1477 void SigninScreenHandler::OnCapsLockChanged(bool enabled) {
1476 caps_lock_enabled_ = enabled; 1478 caps_lock_enabled_ = enabled;
1477 if (page_is_ready()) 1479 if (page_is_ready())
1478 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); 1480 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_);
1479 } 1481 }
1480 1482
1481 } // namespace chromeos 1483 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698