Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
| diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
| index d15de311a2a85e8c40d88ec512ad9dfc5d8d7ed4..e2c91100e2ce359c70a822038922b9328ba8fb38 100644 |
| --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
| +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
| @@ -35,6 +35,7 @@ |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| +#include "chrome/browser/chromeos/language_preferences.h" |
| #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" |
| #include "chrome/browser/chromeos/login/hwid_checker.h" |
| #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| @@ -972,6 +973,9 @@ gfx::NativeWindow SigninScreenHandler::GetNativeWindow() { |
| void SigninScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) { |
| registry->RegisterDictionaryPref(prefs::kUsersLRUInputMethod); |
| + registry->RegisterDictionaryPref(prefs::kLanguageXkbAutoRepeatEnabled); |
| + registry->RegisterDictionaryPref(prefs::kLanguageXkbAutoRepeatDelay); |
| + registry->RegisterDictionaryPref(prefs::kLanguageXkbAutoRepeatInterval); |
| } |
| void SigninScreenHandler::OnCurrentScreenChanged(OobeScreen current_screen, |
| @@ -1436,6 +1440,7 @@ void SigninScreenHandler::HandleFocusPod(const AccountId& account_id) { |
| account_id); |
| } else { |
| SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get()); |
| + SetKeyboardSettings(account_id.GetUserEmail()); |
| WallpaperManager::Get()->SetUserWallpaperDelayed(account_id); |
| bool use_24hour_clock = false; |
| @@ -1611,4 +1616,39 @@ void SigninScreenHandler::OnAllowedInputMethodsChanged() { |
| } |
| } |
| +void SigninScreenHandler::SetKeyboardSettings(const std::string& username) { |
|
Alexander Alekseev
2017/02/17 02:18:23
AccountId ?
|
| + PrefService* const local_state = g_browser_process->local_state(); |
| + |
| + const base::DictionaryValue* auto_repeat_enabled_data = |
| + local_state->GetDictionary(prefs::kLanguageXkbAutoRepeatEnabled); |
| + bool auto_repeat_enabled = true; |
| + if (auto_repeat_enabled_data->GetBooleanWithoutPathExpansion( |
| + username, &auto_repeat_enabled) && |
| + !auto_repeat_enabled) { |
| + input_method::InputMethodManager::Get() |
| + ->GetImeKeyboard() |
| + ->SetAutoRepeatEnabled(false); |
| + return; |
| + } |
| + |
| + const base::DictionaryValue* auto_repeat_delay_data = |
| + local_state->GetDictionary(prefs::kLanguageXkbAutoRepeatDelay); |
| + const base::DictionaryValue* auto_repeat_interval_data = |
| + local_state->GetDictionary(prefs::kLanguageXkbAutoRepeatInterval); |
| + int auto_repeat_delay = language_prefs::kXkbAutoRepeatDelayInMs; |
| + int auto_repeat_interval = language_prefs::kXkbAutoRepeatIntervalInMs; |
| + auto_repeat_delay_data->GetIntegerWithoutPathExpansion(username, |
| + &auto_repeat_delay); |
| + auto_repeat_interval_data->GetIntegerWithoutPathExpansion( |
| + username, &auto_repeat_interval); |
| + input_method::AutoRepeatRate rate; |
| + rate.initial_delay_in_ms = auto_repeat_delay; |
| + rate.repeat_interval_in_ms = auto_repeat_interval; |
| + input_method::InputMethodManager::Get() |
| + ->GetImeKeyboard() |
| + ->SetAutoRepeatEnabled(true); |
| + input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate( |
| + rate); |
| +} |
| + |
| } // namespace chromeos |