Index: components/mus/public/interfaces/input_devices/input_device_server.mojom |
diff --git a/components/mus/public/interfaces/input_devices/input_device_server.mojom b/components/mus/public/interfaces/input_devices/input_device_server.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..532792a7f48faa513f6819fef45fda46b6d6d2ae |
--- /dev/null |
+++ b/components/mus/public/interfaces/input_devices/input_device_server.mojom |
@@ -0,0 +1,43 @@ |
+// 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/events/devices/mojo/input_devices.mojom"; |
+ |
+// Receives updates about changes to input-devices. See InputDeviceServer for |
+// the expected behaviour. |
+interface InputDeviceObserverMojo { |
+ // Is called when the list of keyboards changes. |
+ OnKeyboardDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
+ |
+ // Is called when the list of touchscreens changes. |
+ OnTouchscreenDeviceConfigurationChanged( |
+ array<ui.mojom.TouchscreenDevice> devices); |
+ |
+ // Is called when the list of mice changes. |
+ OnMouseDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
+ |
+ // Is called when the list of touchpads changes. |
+ OnTouchpadDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
+ |
+ // Is called once all of the input-device lists are available. This will |
+ // always be the first call that an observer receives. |
+ OnDeviceListsComplete( |
+ array<ui.mojom.InputDevice> keyboard_devices, |
+ array<ui.mojom.TouchscreenDevice> touchscreen_devices, |
+ array<ui.mojom.InputDevice> mouse_devices, |
+ array<ui.mojom.InputDevice> touchpad_devices); |
+}; |
+ |
+// Sends updates about input-devices to observers. |
+interface InputDeviceServer { |
+ // Adds an InputDeviceObserverMojo in another process as an observer to get |
+ // notified of changes to input-devices over Mojo IPC. If all input-device |
+ // lists are complete when a new observer connects, the implementation will |
+ // immediately call OnDeviceListsComplete() with the input-device lists. If |
+ // not, the implementation will wait until all input-device lists are complete |
+ // then call OnDeviceListsComplete() for all connected observers. |
+ AddObserver(InputDeviceObserverMojo observer); |
+}; |