| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module ui.mojom; | 5 module ui.mojom; |
| 6 | 6 |
| 7 import "ui/events/devices/mojo/input_devices.mojom"; | 7 import "ui/events/devices/mojo/input_devices.mojom"; |
| 8 | 8 |
| 9 // Receives updates about changes to input-devices. See InputDeviceServer for | 9 // Receives updates about changes to input-devices. See InputDeviceServer for |
| 10 // the expected behaviour. | 10 // the expected behaviour. |
| 11 interface InputDeviceObserverMojo { | 11 interface InputDeviceObserverMojo { |
| 12 // Is called when the list of keyboards changes. | 12 // Is called when the list of keyboards changes. |
| 13 OnKeyboardDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); | 13 OnKeyboardDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
| 14 | 14 |
| 15 // Is called when the list of touchscreens changes. | 15 // Is called when the list of touchscreens changes. |
| 16 OnTouchscreenDeviceConfigurationChanged( | 16 OnTouchscreenDeviceConfigurationChanged( |
| 17 array<ui.mojom.TouchscreenDevice> devices); | 17 array<ui.mojom.TouchscreenDevice> devices); |
| 18 | 18 |
| 19 // Is called when the list of mice changes. | 19 // Is called when the list of mice changes. |
| 20 OnMouseDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); | 20 OnMouseDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
| 21 | 21 |
| 22 // Is called when the list of touchpads changes. | 22 // Is called when the list of touchpads changes. |
| 23 OnTouchpadDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); | 23 OnTouchpadDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
| 24 | 24 |
| 25 // Is called when the list of gamepads changes. |
| 26 OnGamepadDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
| 27 |
| 25 // Is called once all of the input-device lists are available. This will | 28 // Is called once all of the input-device lists are available. This will |
| 26 // always be the first call that an observer receives. | 29 // always be the first call that an observer receives. |
| 27 OnDeviceListsComplete( | 30 OnDeviceListsComplete( |
| 28 array<ui.mojom.InputDevice> keyboard_devices, | 31 array<ui.mojom.InputDevice> keyboard_devices, |
| 29 array<ui.mojom.TouchscreenDevice> touchscreen_devices, | 32 array<ui.mojom.TouchscreenDevice> touchscreen_devices, |
| 30 array<ui.mojom.InputDevice> mouse_devices, | 33 array<ui.mojom.InputDevice> mouse_devices, |
| 31 array<ui.mojom.InputDevice> touchpad_devices); | 34 array<ui.mojom.InputDevice> touchpad_devices, |
| 35 array<ui.mojom.InputDevice> gamepad_devices); |
| 32 | 36 |
| 33 // Is called when a stylus is removed or inserted into the device. | 37 // Is called when a stylus is removed or inserted into the device. |
| 34 OnStylusStateChanged(StylusState state); | 38 OnStylusStateChanged(StylusState state); |
| 35 }; | 39 }; |
| 36 | 40 |
| 37 // Sends updates about input-devices to observers. | 41 // Sends updates about input-devices to observers. |
| 38 interface InputDeviceServer { | 42 interface InputDeviceServer { |
| 39 // Adds an InputDeviceObserverMojo in another process as an observer to get | 43 // Adds an InputDeviceObserverMojo in another process as an observer to get |
| 40 // notified of changes to input-devices over Mojo IPC. If all input-device | 44 // notified of changes to input-devices over Mojo IPC. If all input-device |
| 41 // lists are complete when a new observer connects, the implementation will | 45 // lists are complete when a new observer connects, the implementation will |
| 42 // immediately call OnDeviceListsComplete() with the input-device lists. If | 46 // immediately call OnDeviceListsComplete() with the input-device lists. If |
| 43 // not, the implementation will wait until all input-device lists are complete | 47 // not, the implementation will wait until all input-device lists are complete |
| 44 // then call OnDeviceListsComplete() for all connected observers. | 48 // then call OnDeviceListsComplete() for all connected observers. |
| 45 AddObserver(InputDeviceObserverMojo observer); | 49 AddObserver(InputDeviceObserverMojo observer); |
| 46 }; | 50 }; |
| OLD | NEW |