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 "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1025 | 1025 |
1026 void SigninScreenHandler::OnDnsCleared() { | 1026 void SigninScreenHandler::OnDnsCleared() { |
1027 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1027 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1028 dns_clear_task_running_ = false; | 1028 dns_clear_task_running_ = false; |
1029 dns_cleared_ = true; | 1029 dns_cleared_ = true; |
1030 ShowSigninScreenIfReady(); | 1030 ShowSigninScreenIfReady(); |
1031 } | 1031 } |
1032 | 1032 |
1033 // Update keyboard layout to least recently used by the user. | 1033 // Update keyboard layout to least recently used by the user. |
1034 void SigninScreenHandler::SetUserInputMethod(const std::string& username) { | 1034 void SigninScreenHandler::SetUserInputMethod(const std::string& username) { |
1035 UserManager* user_manager = UserManager::Get(); | |
1036 if (user_manager->IsUserLoggedIn()) { | |
Nikita (slow)
2013/09/16 16:28:17
Ideally sign in UI should behave the same whether
Dmitry Polukhin
2013/09/16 18:30:00
Done.
| |
1037 // We are on sign-in screen inside user session (adding new user to | |
1038 // the session or on lock screen), don't switch input methods in this case. | |
1039 return; | |
1040 } | |
1041 | |
1035 chromeos::input_method::InputMethodManager* const manager = | 1042 chromeos::input_method::InputMethodManager* const manager = |
1036 chromeos::input_method::InputMethodManager::Get(); | 1043 chromeos::input_method::InputMethodManager::Get(); |
1037 | 1044 |
1038 const bool succeed = SetUserInputMethodImpl(username, manager); | 1045 const bool succeed = SetUserInputMethodImpl(username, manager); |
1039 | 1046 |
1040 // This is also a case when LRU layout is set only for a few local users, | 1047 // This is also a case when LRU layout is set only for a few local users, |
1041 // thus others need to be switched to default locale. | 1048 // thus others need to be switched to default locale. |
1042 // Otherwise they will end up using another user's locale to log in. | 1049 // Otherwise they will end up using another user's locale to log in. |
1043 if (!succeed) { | 1050 if (!succeed) { |
1044 DLOG(INFO) << "SetUserInputMethod('" << username | 1051 DLOG(INFO) << "SetUserInputMethod('" << username |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1759 rvh->ExecuteJavascriptInWebFrame( | 1766 rvh->ExecuteJavascriptInWebFrame( |
1760 ASCIIToUTF16("//iframe[@id='signin-frame']\n//iframe"), | 1767 ASCIIToUTF16("//iframe[@id='signin-frame']\n//iframe"), |
1761 ASCIIToUTF16(code)); | 1768 ASCIIToUTF16(code)); |
1762 | 1769 |
1763 // Test properties are cleared in HandleCompleteLogin because the form | 1770 // Test properties are cleared in HandleCompleteLogin because the form |
1764 // submission might fail and login will not be attempted after reloading | 1771 // submission might fail and login will not be attempted after reloading |
1765 // if they are cleared here. | 1772 // if they are cleared here. |
1766 } | 1773 } |
1767 | 1774 |
1768 } // namespace chromeos | 1775 } // namespace chromeos |
OLD | NEW |