Chromium Code Reviews| 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..fa738b98d962e1dc76843aae5c8ecee1f62fae94 |
| --- /dev/null |
| +++ b/components/mus/public/interfaces/input_devices/input_devices.mojom |
| @@ -0,0 +1,39 @@ |
| +// 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 { |
| + OnKeyboardDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
| + OnTouchscreenDeviceConfigurationChanged( |
| + array<ui.mojom.TouchscreenDevice> devices); |
| + OnMouseDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
| + OnTouchpadDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); |
| + |
| + // Will be called after the observer has received all of the input-device |
| + // lists. Until this is called the observer does not know if an empty list is |
| + // empty or has yet to be received. |
| + OnDeviceListsComplete(); |
|
sadrul
2016/06/08 16:31:09
OK. So, it sounds like once the observer registers
kylechar
2016/06/08 18:13:16
Yeah, that's definitely possible. Not sure it will
|
| +}; |
| + |
| +// When the implementation receives an updated input-device list it will send |
| +// the new list to all registered observers. Additionally, if receives |
| +// OnDeviceListsComplete() it will send that message to all registered |
| +// observers as well. |
| +interface InputDeviceServer { |
| + // Adds an InputDeviceObserverMojo in another process as an observer to get |
| + // notified of changes to input-devices over Mojo IPC. The implementation |
| + // should send available list of input-devices to a new observer when it |
| + // connects. |
| + // |
| + // The implementation should also call OnDeviceListsComplete() after sending |
| + // all input-device lists to an observer, assuming it has received all of the |
| + // input-device lists itself. Otherwise the implementation will wait until it |
| + // receives OnDeviceListsComplete() to send the message to observers. |
| + AddObserver(InputDeviceObserverMojo observer); |
| +}; |