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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 // loaded because it can affect the loading speed. | 1023 // loaded because it can affect the loading speed. |
1024 // Do not load the extension for the screen locker, see crosbug.com/25018. | 1024 // Do not load the extension for the screen locker, see crosbug.com/25018. |
1025 return !ScreenLocker::default_screen_locker() && | 1025 return !ScreenLocker::default_screen_locker() && |
1026 is_account_picker_showing_first_time_; | 1026 is_account_picker_showing_first_time_; |
1027 } | 1027 } |
1028 | 1028 |
1029 // Update keyboard layout to least recently used by the user. | 1029 // Update keyboard layout to least recently used by the user. |
1030 void SigninScreenHandler::SetUserInputMethod( | 1030 void SigninScreenHandler::SetUserInputMethod( |
1031 const std::string& username, | 1031 const std::string& username, |
1032 input_method::InputMethodManager::State* ime_state) { | 1032 input_method::InputMethodManager::State* ime_state) { |
1033 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | |
1034 if (user_manager->IsUserLoggedIn()) { | |
1035 // We are on sign-in screen inside user session (adding new user to | |
1036 // the session or on lock screen), don't switch input methods in this case. | |
1037 // TODO(dpolukhin): adding user and sign-in should be consistent | |
1038 // crbug.com/292774 | |
1039 return; | |
1040 } | |
1041 | |
1042 bool succeed = false; | 1033 bool succeed = false; |
1043 | 1034 |
1044 const std::string input_method = GetUserLRUInputMethod(username); | 1035 const std::string input_method = GetUserLRUInputMethod(username); |
1045 | 1036 |
1046 if (!input_method.empty()) | 1037 if (!input_method.empty()) |
1047 succeed = SetUserInputMethodImpl(username, input_method, ime_state); | 1038 succeed = SetUserInputMethodImpl(username, input_method, ime_state); |
1048 | 1039 |
1049 // This is also a case when LRU layout is set only for a few local users, | 1040 // This is also a case when LRU layout is set only for a few local users, |
1050 // thus others need to be switched to default locale. | 1041 // thus others need to be switched to default locale. |
1051 // Otherwise they will end up using another user's locale to log in. | 1042 // Otherwise they will end up using another user's locale to log in. |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 return gaia_screen_handler_->frame_error(); | 1545 return gaia_screen_handler_->frame_error(); |
1555 } | 1546 } |
1556 | 1547 |
1557 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1548 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
1558 caps_lock_enabled_ = enabled; | 1549 caps_lock_enabled_ = enabled; |
1559 if (page_is_ready()) | 1550 if (page_is_ready()) |
1560 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1551 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
1561 } | 1552 } |
1562 | 1553 |
1563 } // namespace chromeos | 1554 } // namespace chromeos |
OLD | NEW |