| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/task_scheduler/post_task.h" | 15 #include "base/task_scheduler/post_task.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/browser_shutdown.h" | 18 #include "chrome/browser/browser_shutdown.h" |
| 19 #include "chrome/browser/chromeos/language_preferences.h" | 19 #include "chrome/browser/chromeos/language_preferences.h" |
| 20 #include "chrome/browser/chromeos/login/lock_screen_utils.h" |
| 20 #include "chrome/browser/chromeos/login/screens/network_error.h" | 21 #include "chrome/browser/chromeos/login/screens/network_error.h" |
| 21 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 22 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| 22 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 23 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 23 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" | 24 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" |
| 24 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 25 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 25 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 26 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| 26 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 27 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 27 #include "chrome/browser/chromeos/settings/cros_settings.h" | 28 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 28 #include "chrome/browser/io_thread.h" | 29 #include "chrome/browser/io_thread.h" |
| 29 #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" | 30 #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 | 873 |
| 873 input_method::InputMethodManager* imm = | 874 input_method::InputMethodManager* imm = |
| 874 input_method::InputMethodManager::Get(); | 875 input_method::InputMethodManager::Get(); |
| 875 | 876 |
| 876 scoped_refptr<input_method::InputMethodManager::State> gaia_ime_state = | 877 scoped_refptr<input_method::InputMethodManager::State> gaia_ime_state = |
| 877 imm->GetActiveIMEState()->Clone(); | 878 imm->GetActiveIMEState()->Clone(); |
| 878 imm->SetState(gaia_ime_state); | 879 imm->SetState(gaia_ime_state); |
| 879 | 880 |
| 880 // Set Least Recently Used input method for the user. | 881 // Set Least Recently Used input method for the user. |
| 881 if (!populated_email_.empty()) { | 882 if (!populated_email_.empty()) { |
| 882 SigninScreenHandler::SetUserInputMethod(populated_email_, | 883 lock_screen_utils::SetUserInputMethod(populated_email_, |
| 883 gaia_ime_state.get()); | 884 gaia_ime_state.get()); |
| 884 } else { | 885 } else { |
| 885 std::vector<std::string> input_methods; | 886 std::vector<std::string> input_methods; |
| 886 if (gaia_ime_state->GetAllowedInputMethods().empty()) { | 887 if (gaia_ime_state->GetAllowedInputMethods().empty()) { |
| 887 input_methods = | 888 input_methods = |
| 888 imm->GetInputMethodUtil()->GetHardwareLoginInputMethodIds(); | 889 imm->GetInputMethodUtil()->GetHardwareLoginInputMethodIds(); |
| 889 } else { | 890 } else { |
| 890 input_methods = gaia_ime_state->GetAllowedInputMethods(); | 891 input_methods = gaia_ime_state->GetAllowedInputMethods(); |
| 891 } | 892 } |
| 892 const std::string owner_im = SigninScreenHandler::GetUserLastInputMethod( | 893 const std::string owner_im = lock_screen_utils::GetUserLastInputMethod( |
| 893 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail()); | 894 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail()); |
| 894 const std::string system_im = g_browser_process->local_state()->GetString( | 895 const std::string system_im = g_browser_process->local_state()->GetString( |
| 895 language_prefs::kPreferredKeyboardLayout); | 896 language_prefs::kPreferredKeyboardLayout); |
| 896 | 897 |
| 897 PushFrontIMIfNotExists(owner_im, &input_methods); | 898 PushFrontIMIfNotExists(owner_im, &input_methods); |
| 898 PushFrontIMIfNotExists(system_im, &input_methods); | 899 PushFrontIMIfNotExists(system_im, &input_methods); |
| 899 | 900 |
| 900 gaia_ime_state->EnableLoginLayouts( | 901 gaia_ime_state->EnableLoginLayouts( |
| 901 g_browser_process->GetApplicationLocale(), input_methods); | 902 g_browser_process->GetApplicationLocale(), input_methods); |
| 902 | 903 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 980 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 980 return signin_screen_handler_->delegate_; | 981 return signin_screen_handler_->delegate_; |
| 981 } | 982 } |
| 982 | 983 |
| 983 bool GaiaScreenHandler::IsRestrictiveProxy() const { | 984 bool GaiaScreenHandler::IsRestrictiveProxy() const { |
| 984 return !disable_restrictive_proxy_check_for_test_ && | 985 return !disable_restrictive_proxy_check_for_test_ && |
| 985 !IsOnline(captive_portal_status_); | 986 !IsOnline(captive_portal_status_); |
| 986 } | 987 } |
| 987 | 988 |
| 988 } // namespace chromeos | 989 } // namespace chromeos |
| OLD | NEW |