Index: components/mus/public/interfaces/input_devices/input_devices.mojom |
diff --git a/components/mus/public/interfaces/input_devices/input_devices.mojom b/components/mus/public/interfaces/input_devices/input_devices.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..34fec90435db377a3377831b8520ebb05da013da |
--- /dev/null |
+++ b/components/mus/public/interfaces/input_devices/input_devices.mojom |
@@ -0,0 +1,48 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+module input_device.mojom; |
+ |
+import "ui/gfx/geometry/mojo/geometry.mojom"; |
+ |
+// Corresponds to ui::InputDeviceType |
+enum InputDeviceType { |
+ INPUT_DEVICE_INTERNAL, |
+ INPUT_DEVICE_EXTERNAL, |
+ INPUT_DEVICE_UNKNOWN, |
+}; |
+ |
+// Corresponds to ui::InputDevice. |
+struct InputDevice { |
+ int32 id; |
+ InputDeviceType type; |
+ string name; |
+ string sys_path; |
+ uint16 vendor_id; |
+ uint16 product_id; |
+}; |
+ |
+// Corresponds to ui::TouchscreenDevice. |
+struct TouchscreenDevice { |
+ // Base class. |
+ InputDevice input_device; |
sadrul
2016/06/07 03:39:26
Hm, do we do subclassing like this in other places
kylechar
2016/06/07 16:36:42
Oh, so looking at mojom.Event it's definitely done
|
+ |
+ gfx.mojom.Size size; |
+ int32 touch_points; |
+}; |
sadrul
2016/06/07 03:39:26
The above should move into //ui/events/mojo/ (or /
kylechar
2016/06/07 16:36:42
Done.
|
+ |
+// Receives updates about changes to input-devices. |
+interface InputDeviceObserverMojo { |
+ OnKeyboardDeviceConfigurationChanged(array<InputDevice> devices); |
sadrul
2016/06/07 03:39:26
Can you document these? For example, when an obser
kylechar
2016/06/07 16:36:42
I added better documentation. Most of it is under
|
+ OnTouchscreenDeviceConfigurationChanged(array<TouchscreenDevice> devices); |
+ OnMouseDeviceConfigurationChanged(array<InputDevice> devices); |
+ OnTouchpadDeviceConfigurationChanged(array<InputDevice> devices); |
+ OnDeviceListsComplete(); |
sadrul
2016/06/07 03:39:26
I am also wondering if OnDevicesListsComplete() is
kylechar
2016/06/07 16:36:42
I believe it's the easiest/best way to do this. By
|
+}; |
+ |
+interface InputDeviceServer { |
+ // Adds an InputDeviceObserverMojo in another process as an observer to get |
+ // notified of changes to input-devices over Mojo IPC. |
+ AddObserver(InputDeviceObserverMojo observer); |
+}; |