| Index: services/ui/public/cpp/input_devices/input_device_client.cc
|
| diff --git a/services/ui/public/cpp/input_devices/input_device_client.cc b/services/ui/public/cpp/input_devices/input_device_client.cc
|
| index 07593c1ded8fb0baad2d0b3b6e9276c410fb9299..f5aab95eacf9821de21229e84b77619a30b3c98a 100644
|
| --- a/services/ui/public/cpp/input_devices/input_device_client.cc
|
| +++ b/services/ui/public/cpp/input_devices/input_device_client.cc
|
| @@ -39,6 +39,11 @@ const std::vector<ui::InputDevice>& InputDeviceClient::GetTouchpadDevices()
|
| return touchpad_devices_;
|
| }
|
|
|
| +const std::vector<ui::InputDevice>& InputDeviceClient::GetGamepadDevices()
|
| + const {
|
| + return gamepad_devices_;
|
| +}
|
| +
|
| bool InputDeviceClient::AreDeviceListsComplete() const {
|
| return device_lists_complete_;
|
| }
|
| @@ -95,11 +100,19 @@ void InputDeviceClient::OnTouchpadDeviceConfigurationChanged(
|
| observer.OnTouchpadDeviceConfigurationChanged();
|
| }
|
|
|
| +void InputDeviceClient::OnGamepadDeviceConfigurationChanged(
|
| + const std::vector<ui::InputDevice>& devices) {
|
| + gamepad_devices_ = devices;
|
| + for (auto& observer : observers_)
|
| + observer.OnGamepadDeviceConfigurationChanged();
|
| +}
|
| +
|
| void InputDeviceClient::OnDeviceListsComplete(
|
| const std::vector<ui::InputDevice>& keyboard_devices,
|
| const std::vector<ui::TouchscreenDevice>& touchscreen_devices,
|
| const std::vector<ui::InputDevice>& mouse_devices,
|
| - const std::vector<ui::InputDevice>& touchpad_devices) {
|
| + const std::vector<ui::InputDevice>& touchpad_devices,
|
| + const std::vector<ui::InputDevice>& gamepad_devices) {
|
| // Update the cached device lists if the received list isn't empty.
|
| if (!keyboard_devices.empty())
|
| OnKeyboardDeviceConfigurationChanged(keyboard_devices);
|
| @@ -109,6 +122,8 @@ void InputDeviceClient::OnDeviceListsComplete(
|
| OnMouseDeviceConfigurationChanged(mouse_devices);
|
| if (!touchpad_devices.empty())
|
| OnTouchpadDeviceConfigurationChanged(touchpad_devices);
|
| + if (!gamepad_devices_.empty())
|
| + OnGamepadDeviceConfigurationChanged(gamepad_devices_);
|
|
|
| if (!device_lists_complete_) {
|
| device_lists_complete_ = true;
|
|
|