| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ui/base/ime/chromeos/ime_keyboard_mus.h" | 5 #include "ui/base/ime/chromeos/ime_keyboard_mus.h" |
| 6 | 6 |
| 7 #include "services/ui/public/cpp/input_devices/input_device_controller_client.h" | 7 #include "services/ui/public/cpp/input_devices/input_device_controller_client.h" |
| 8 | 8 |
| 9 namespace chromeos { | 9 namespace chromeos { |
| 10 namespace input_method { | 10 namespace input_method { |
| 11 | 11 |
| 12 ImeKeyboardMus::ImeKeyboardMus( | 12 ImeKeyboardMus::ImeKeyboardMus( |
| 13 ui::InputDeviceControllerClient* input_device_controller_client) | 13 ui::InputDeviceControllerClient* input_device_controller_client) |
| 14 : input_device_controller_client_(input_device_controller_client) { | 14 : input_device_controller_client_(input_device_controller_client) { |
| 15 ImeKeyboard::SetCapsLockEnabled(CapsLockIsEnabled()); | 15 ImeKeyboard::SetCapsLockEnabled(CapsLockIsEnabled()); |
| 16 } | 16 } |
| 17 | 17 |
| 18 ImeKeyboardMus::~ImeKeyboardMus() = default; | 18 ImeKeyboardMus::~ImeKeyboardMus() = default; |
| 19 | 19 |
| 20 bool ImeKeyboardMus::SetCurrentKeyboardLayoutByName( | 20 bool ImeKeyboardMus::SetCurrentKeyboardLayoutByName( |
| 21 const std::string& layout_name) { | 21 const std::string& layout_name) { |
| 22 ImeKeyboard::SetCurrentKeyboardLayoutByName(layout_name); |
| 22 last_layout_ = layout_name; | 23 last_layout_ = layout_name; |
| 23 input_device_controller_client_->SetKeyboardLayoutByName(layout_name); | 24 input_device_controller_client_->SetKeyboardLayoutByName(layout_name); |
| 24 return true; | 25 return true; |
| 25 } | 26 } |
| 26 | 27 |
| 27 bool ImeKeyboardMus::SetAutoRepeatRate(const AutoRepeatRate& rate) { | 28 bool ImeKeyboardMus::SetAutoRepeatRate(const AutoRepeatRate& rate) { |
| 28 input_device_controller_client_->SetAutoRepeatRate( | 29 input_device_controller_client_->SetAutoRepeatRate( |
| 29 base::TimeDelta::FromMilliseconds(rate.initial_delay_in_ms), | 30 base::TimeDelta::FromMilliseconds(rate.initial_delay_in_ms), |
| 30 base::TimeDelta::FromMilliseconds(rate.repeat_interval_in_ms)); | 31 base::TimeDelta::FromMilliseconds(rate.repeat_interval_in_ms)); |
| 31 return true; | 32 return true; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 56 // Inform Ozone InputController input of caps lock state. | 57 // Inform Ozone InputController input of caps lock state. |
| 57 input_device_controller_client_->SetCapsLockEnabled(enable_caps_lock); | 58 input_device_controller_client_->SetCapsLockEnabled(enable_caps_lock); |
| 58 } | 59 } |
| 59 | 60 |
| 60 bool ImeKeyboardMus::CapsLockIsEnabled() { | 61 bool ImeKeyboardMus::CapsLockIsEnabled() { |
| 61 return input_device_controller_client_->IsCapsLockEnabled(); | 62 return input_device_controller_client_->IsCapsLockEnabled(); |
| 62 } | 63 } |
| 63 | 64 |
| 64 } // namespace input_method | 65 } // namespace input_method |
| 65 } // namespace chromeos | 66 } // namespace chromeos |
| OLD | NEW |