Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module input_device.mojom; | |
| 6 | |
| 7 import "ui/gfx/geometry/mojo/geometry.mojom"; | |
| 8 | |
| 9 // Corresponds to ui::InputDeviceType | |
| 10 enum InputDeviceType { | |
| 11 INPUT_DEVICE_INTERNAL, | |
| 12 INPUT_DEVICE_EXTERNAL, | |
| 13 INPUT_DEVICE_UNKNOWN, | |
| 14 }; | |
| 15 | |
| 16 // Corresponds to ui::InputDevice. | |
| 17 struct InputDevice { | |
| 18 int32 id; | |
| 19 InputDeviceType type; | |
| 20 string name; | |
| 21 string sys_path; | |
| 22 uint16 vendor_id; | |
| 23 uint16 product_id; | |
| 24 }; | |
| 25 | |
| 26 // Corresponds to ui::TouchscreenDevice. | |
| 27 struct TouchscreenDevice { | |
| 28 // Base class. | |
| 29 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
| |
| 30 | |
| 31 gfx.mojom.Size size; | |
| 32 int32 touch_points; | |
| 33 }; | |
|
sadrul
2016/06/07 03:39:26
The above should move into //ui/events/mojo/ (or /
kylechar
2016/06/07 16:36:42
Done.
| |
| 34 | |
| 35 // Receives updates about changes to input-devices. | |
| 36 interface InputDeviceObserverMojo { | |
| 37 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
| |
| 38 OnTouchscreenDeviceConfigurationChanged(array<TouchscreenDevice> devices); | |
| 39 OnMouseDeviceConfigurationChanged(array<InputDevice> devices); | |
| 40 OnTouchpadDeviceConfigurationChanged(array<InputDevice> devices); | |
| 41 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
| |
| 42 }; | |
| 43 | |
| 44 interface InputDeviceServer { | |
| 45 // Adds an InputDeviceObserverMojo in another process as an observer to get | |
| 46 // notified of changes to input-devices over Mojo IPC. | |
| 47 AddObserver(InputDeviceObserverMojo observer); | |
| 48 }; | |
| OLD | NEW |