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

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

Issue 2816543004: Login screen IME policy does not apply in user session (Closed)
Patch Set: Fixed browsertests. Created 3 years, 8 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 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
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();
xiyuan 2017/04/12 17:42:07 nit: wrap with {} and else since this takes more t
pmarko 2017/04/12 19:05:36 Done.
884 else
885 input_methods = gaia_ime_state->GetAllowedInputMethods();
882 const std::string owner_im = SigninScreenHandler::GetUserLastInputMethod( 886 const std::string owner_im = SigninScreenHandler::GetUserLastInputMethod(
883 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail()); 887 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail());
884 const std::string system_im = g_browser_process->local_state()->GetString( 888 const std::string system_im = g_browser_process->local_state()->GetString(
885 language_prefs::kPreferredKeyboardLayout); 889 language_prefs::kPreferredKeyboardLayout);
886 890
887 PushFrontIMIfNotExists(owner_im, &input_methods); 891 PushFrontIMIfNotExists(owner_im, &input_methods);
888 PushFrontIMIfNotExists(system_im, &input_methods); 892 PushFrontIMIfNotExists(system_im, &input_methods);
889 893
890 gaia_ime_state->EnableLoginLayouts( 894 gaia_ime_state->EnableLoginLayouts(
891 g_browser_process->GetApplicationLocale(), input_methods); 895 g_browser_process->GetApplicationLocale(), input_methods);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { 973 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() {
970 return signin_screen_handler_->delegate_; 974 return signin_screen_handler_->delegate_;
971 } 975 }
972 976
973 bool GaiaScreenHandler::IsRestrictiveProxy() const { 977 bool GaiaScreenHandler::IsRestrictiveProxy() const {
974 return !disable_restrictive_proxy_check_for_test_ && 978 return !disable_restrictive_proxy_check_for_test_ &&
975 !IsOnline(captive_portal_status_); 979 !IsOnline(captive_portal_status_);
976 } 980 }
977 981
978 } // namespace chromeos 982 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698