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

Unified Diff: services/ui/input_devices/input_device_server.cc

Issue 2805793002: ozone: evdev: Add gamepad support (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/input_devices/input_device_server.cc
diff --git a/services/ui/input_devices/input_device_server.cc b/services/ui/input_devices/input_device_server.cc
index d254cba9df143af9897f813d273c87cf86a65366..4f0f02bd54ed3255cbfa6209771f1f0d2dd31732 100644
--- a/services/ui/input_devices/input_device_server.cc
+++ b/services/ui/input_devices/input_device_server.cc
@@ -88,6 +88,16 @@ void InputDeviceServer::OnTouchpadDeviceConfigurationChanged() {
});
}
+void InputDeviceServer::OnGamepadDeviceConfigurationChanged() {
+ if (!manager_->AreDeviceListsComplete())
+ return;
+
+ auto& devices = manager_->GetGamepadDevices();
+ observers_.ForAllPtrs([&devices](mojom::InputDeviceObserverMojo* observer) {
+ observer->OnGamepadDeviceConfigurationChanged(devices);
+ });
+}
+
void InputDeviceServer::OnDeviceListsComplete() {
observers_.ForAllPtrs([this](mojom::InputDeviceObserverMojo* observer) {
SendDeviceListsComplete(observer);
@@ -106,7 +116,8 @@ void InputDeviceServer::SendDeviceListsComplete(
observer->OnDeviceListsComplete(
manager_->GetKeyboardDevices(), manager_->GetTouchscreenDevices(),
- manager_->GetMouseDevices(), manager_->GetTouchpadDevices());
+ manager_->GetMouseDevices(), manager_->GetTouchpadDevices(),
+ manager_->GetGamepadDevices());
}
void InputDeviceServer::Create(const service_manager::Identity& remote_identity,

Powered by Google App Engine
This is Rietveld 408576698