Index: ui/events/ozone/evdev/input_controller_evdev.cc |
diff --git a/ui/events/ozone/evdev/input_controller_evdev.cc b/ui/events/ozone/evdev/input_controller_evdev.cc |
index 19c728b39b70837a890a892e2009f66628ac0d85..9e65740b7adb5f8b1eb64ee64df2839613618a12 100644 |
--- a/ui/events/ozone/evdev/input_controller_evdev.cc |
+++ b/ui/events/ozone/evdev/input_controller_evdev.cc |
@@ -22,6 +22,7 @@ InputControllerEvdev::InputControllerEvdev(KeyboardEvdev* keyboard, |
button_map_(button_map), |
has_mouse_(false), |
has_touchpad_(false), |
+ caps_lock_led_state_(false), |
weak_ptr_factory_(this) { |
} |
@@ -33,6 +34,7 @@ void InputControllerEvdev::SetInputDeviceFactory( |
input_device_factory_ = input_device_factory; |
UpdateDeviceSettings(); |
+ UpdateCapsLockLed(); |
} |
void InputControllerEvdev::set_has_mouse(bool has_mouse) { |
@@ -57,6 +59,7 @@ bool InputControllerEvdev::IsCapsLockEnabled() { |
void InputControllerEvdev::SetCapsLockEnabled(bool enabled) { |
keyboard_->SetCapsLockEnabled(enabled); |
+ UpdateCapsLockLed(); |
} |
void InputControllerEvdev::SetNumLockEnabled(bool enabled) { |
@@ -178,4 +181,13 @@ void InputControllerEvdev::UpdateDeviceSettings() { |
settings_update_pending_ = false; |
} |
+void InputControllerEvdev::UpdateCapsLockLed() { |
+ if (!input_device_factory_) |
+ return; |
+ bool caps_lock_state = IsCapsLockEnabled(); |
+ if (caps_lock_state != caps_lock_led_state_) |
+ input_device_factory_->SetCapsLockLed(caps_lock_state); |
+ caps_lock_led_state_ = caps_lock_state; |
+} |
+ |
} // namespace ui |