| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/gaia_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
| 6 | 6 |
| 7 #include "ash/system/devicetype_utils.h" | 7 #include "ash/system/devicetype_utils.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 | 870 |
| 871 scoped_refptr<input_method::InputMethodManager::State> gaia_ime_state = | 871 scoped_refptr<input_method::InputMethodManager::State> gaia_ime_state = |
| 872 imm->GetActiveIMEState()->Clone(); | 872 imm->GetActiveIMEState()->Clone(); |
| 873 imm->SetState(gaia_ime_state); | 873 imm->SetState(gaia_ime_state); |
| 874 | 874 |
| 875 // Set Least Recently Used input method for the user. | 875 // Set Least Recently Used input method for the user. |
| 876 if (!populated_email_.empty()) { | 876 if (!populated_email_.empty()) { |
| 877 SigninScreenHandler::SetUserInputMethod(populated_email_, | 877 SigninScreenHandler::SetUserInputMethod(populated_email_, |
| 878 gaia_ime_state.get()); | 878 gaia_ime_state.get()); |
| 879 } else { | 879 } else { |
| 880 std::vector<std::string> input_methods = | 880 std::vector<std::string> input_methods; |
| 881 imm->GetInputMethodUtil()->GetHardwareLoginInputMethodIds(); | 881 if (gaia_ime_state->GetAllowedInputMethods().empty()) { |
| 882 input_methods = |
| 883 imm->GetInputMethodUtil()->GetHardwareLoginInputMethodIds(); |
| 884 } else { |
| 885 input_methods = gaia_ime_state->GetAllowedInputMethods(); |
| 886 } |
| 882 const std::string owner_im = SigninScreenHandler::GetUserLastInputMethod( | 887 const std::string owner_im = SigninScreenHandler::GetUserLastInputMethod( |
| 883 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail()); | 888 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail()); |
| 884 const std::string system_im = g_browser_process->local_state()->GetString( | 889 const std::string system_im = g_browser_process->local_state()->GetString( |
| 885 language_prefs::kPreferredKeyboardLayout); | 890 language_prefs::kPreferredKeyboardLayout); |
| 886 | 891 |
| 887 PushFrontIMIfNotExists(owner_im, &input_methods); | 892 PushFrontIMIfNotExists(owner_im, &input_methods); |
| 888 PushFrontIMIfNotExists(system_im, &input_methods); | 893 PushFrontIMIfNotExists(system_im, &input_methods); |
| 889 | 894 |
| 890 gaia_ime_state->EnableLoginLayouts( | 895 gaia_ime_state->EnableLoginLayouts( |
| 891 g_browser_process->GetApplicationLocale(), input_methods); | 896 g_browser_process->GetApplicationLocale(), input_methods); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 974 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 970 return signin_screen_handler_->delegate_; | 975 return signin_screen_handler_->delegate_; |
| 971 } | 976 } |
| 972 | 977 |
| 973 bool GaiaScreenHandler::IsRestrictiveProxy() const { | 978 bool GaiaScreenHandler::IsRestrictiveProxy() const { |
| 974 return !disable_restrictive_proxy_check_for_test_ && | 979 return !disable_restrictive_proxy_check_for_test_ && |
| 975 !IsOnline(captive_portal_status_); | 980 !IsOnline(captive_portal_status_); |
| 976 } | 981 } |
| 977 | 982 |
| 978 } // namespace chromeos | 983 } // namespace chromeos |
| OLD | NEW |