Chrome currently uses DeviceDataManager (https://code.google.com/p/chromium/codesearch#chromium/src/ui/events/devices/device_data_manager.h&sq=package:chromium&type=cs&l=30) instances to explore the input devices on the system (e.g. figure out if touchscreen/touchpad etc. are available, get notified when a new input device is available, etc.). Additionally on ChromeOS, InputController (https://code.google.com/p/chromium/codesearch#chromium/src/ui/ozone/public/input_controller.h&sq=package:chromium&type=cs&l=31) is also used to explore the input devices on the system, as well as configure the input devices. Both of these should be moved into an input-device service.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/89e8aa10b94fe0a7fecdda053778be7424f87bb3 commit 89e8aa10b94fe0a7fecdda053778be7424f87bb3 Author: sadrul <sadrul@chromium.org> Date: Tue Apr 12 17:33:00 2016 mash: Use a stub InputController implementation when running mustash. BUG= 601981 , 601983 Review URL: https://codereview.chromium.org/1883453002 Cr-Commit-Position: refs/heads/master@{#386732} [modify] https://crrev.com/89e8aa10b94fe0a7fecdda053778be7424f87bb3/chrome/browser/chromeos/system/input_device_settings_impl_ozone.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/65cb32e4bac337419a78cc63fcd795567b130385 commit 65cb32e4bac337419a78cc63fcd795567b130385 Author: kylechar <kylechar@chromium.org> Date: Tue May 31 22:19:48 2016 Remove KeyboardDevice class. The KeyboardDevice class is a subclass of InputDevice that adds no new functionality. This makes it unnecessary and adds additional burden when designing Mojo structs to move around input device information. Remove the KeyboardDevice class and replace all uses with InputDevice instead. BUG= 601981 Review-Url: https://codereview.chromium.org/2019413002 Cr-Commit-Position: refs/heads/master@{#396950} [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ash/test/virtual_keyboard_test_helper.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ash/virtual_keyboard_controller.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ash/virtual_keyboard_controller_unittest.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/chrome/browser/chromeos/events/event_rewriter.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/devices/BUILD.gn [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/devices/device_data_manager.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/devices/device_data_manager.h [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/devices/device_hotplug_event_observer.h [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/devices/events_devices.gyp [delete] https://crrev.com/cf0664e7b1ef30b64cec1774af46ce20e9c68dfe/ui/events/devices/keyboard_device.cc [delete] https://crrev.com/cf0664e7b1ef30b64cec1774af46ce20e9c68dfe/ui/events/devices/keyboard_device.h [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/devices/x11/device_data_manager_x11.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/devices/x11/device_data_manager_x11.h [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/devices/x11/device_data_manager_x11_unittest.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/ozone/evdev/device_event_dispatcher_evdev.h [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/ozone/evdev/event_converter_test_util.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/ozone/evdev/event_factory_evdev.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/ozone/evdev/event_factory_evdev.h [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/ozone/evdev/input_device_factory_evdev.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc [modify] https://crrev.com/65cb32e4bac337419a78cc63fcd795567b130385/ui/events/platform/x11/x11_hotplug_event_handler.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e223f03206a1f3a34141f36c39ad6f77557bea0d commit e223f03206a1f3a34141f36c39ad6f77557bea0d Author: kylechar <kylechar@chromium.org> Date: Fri Jun 03 15:02:53 2016 Add new InputDeviceManager interface. This interface contains the methods from DeviceDataManager that we want to expose in multiple processes for mash. A different implementation of the interface will be required to mirror input device state. This will come in a follow up CL. InputDeviceManager holds a non-owning static pointer to an implementation. This allows client code to be agnostic to which implementation they are using. Update client code that uses DeviceDataManager to get information about input-devices to use InputDeviceManager instead. This should have identical functionality in cash and be suitable for use with mash. There is client code where DeviceDataManager is used for information about touch transforms or where DeviceDataManager state is manipulated in tests. These cases are beyond the scope of InputDeviceManager and client code was not updated here. BUG= 601981 Review-Url: https://codereview.chromium.org/2028593004 Cr-Commit-Position: refs/heads/master@{#397707} [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ash/display/display_change_observer_chromeos.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ash/touch/touch_transformer_controller.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ash/virtual_keyboard_controller.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/chrome/browser/chromeos/events/event_rewriter.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/chrome/browser/chromeos/system/pointer_device_observer.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/base/material_design/material_design_controller.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/base/touch/touch_device_linux.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/BUILD.gn [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/device_data_manager.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/device_data_manager.h [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/events_devices.gyp [add] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/input_device_manager.cc [add] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/input_device_manager.h [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/x11/device_data_manager_x11.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/x11/device_data_manager_x11_unittest.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/devices/x11/touch_factory_x11.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/events/x/events_x_utils.cc [modify] https://crrev.com/e223f03206a1f3a34141f36c39ad6f77557bea0d/ui/ozone/platform/egltest/ozone_platform_egltest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f1684a532b1eb8f8182d4f3a2298c045bf0489be commit f1684a532b1eb8f8182d4f3a2298c045bf0489be Author: kylechar <kylechar@chromium.org> Date: Thu Jun 09 17:54:16 2016 Add Mojo structs and StructTraits for //ui/events/devices. Add structs for ui::InputDevice and ui::TouchscreenDevice so they can be shared between processes. Add StructTraits for the structs for automatic type conversions. The Mojo structs used composition instead of inheritance, as inheritance is unsupported. BUG= 601981 Review-Url: https://codereview.chromium.org/2054463002 Cr-Commit-Position: refs/heads/master@{#398942} [modify] https://crrev.com/f1684a532b1eb8f8182d4f3a2298c045bf0489be/mojo/public/tools/bindings/chromium_bindings_configuration.gni [add] https://crrev.com/f1684a532b1eb8f8182d4f3a2298c045bf0489be/ui/events/devices/mojo/BUILD.gn [add] https://crrev.com/f1684a532b1eb8f8182d4f3a2298c045bf0489be/ui/events/devices/mojo/OWNERS [add] https://crrev.com/f1684a532b1eb8f8182d4f3a2298c045bf0489be/ui/events/devices/mojo/input_device.typemap [add] https://crrev.com/f1684a532b1eb8f8182d4f3a2298c045bf0489be/ui/events/devices/mojo/input_device_struct_traits.h [add] https://crrev.com/f1684a532b1eb8f8182d4f3a2298c045bf0489be/ui/events/devices/mojo/input_devices.mojom [add] https://crrev.com/f1684a532b1eb8f8182d4f3a2298c045bf0489be/ui/events/devices/mojo/touchscreen_device.typemap [add] https://crrev.com/f1684a532b1eb8f8182d4f3a2298c045bf0489be/ui/events/devices/mojo/typemaps.gni
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/edbac87b7a0fbe93a323840e2f143686e4065b10 commit edbac87b7a0fbe93a323840e2f143686e4065b10 Author: kylechar <kylechar@chromium.org> Date: Wed Jun 15 19:20:01 2016 Add Mojo IPC based input-device service. Add Mojo interfaces to pass information about input-devices between processes. InputDeviceServer listens for updates about input-devices from DeviceDataManager and holds a list of out of process observers. It forwards updates via Mojo IPC to observers. InputDeviceClient registers as a Mojo observer with InputDeviceServer and holds a list of in process observers. It receives updates about input-devices from InputDeviceServer, caches the information and notifies in process observers. InputDeviceClient will replace the stub DeviceDataManager instance that is created in ash and chrome. Code is unused at this point, will be activated in a followup CL. BUG= 601981 Review-Url: https://codereview.chromium.org/1992443002 Cr-Commit-Position: refs/heads/master@{#399986} [add] https://crrev.com/edbac87b7a0fbe93a323840e2f143686e4065b10/components/mus/input_devices/BUILD.gn [add] https://crrev.com/edbac87b7a0fbe93a323840e2f143686e4065b10/components/mus/input_devices/input_device_server.cc [add] https://crrev.com/edbac87b7a0fbe93a323840e2f143686e4065b10/components/mus/input_devices/input_device_server.h [add] https://crrev.com/edbac87b7a0fbe93a323840e2f143686e4065b10/components/mus/public/cpp/input_devices/BUILD.gn [add] https://crrev.com/edbac87b7a0fbe93a323840e2f143686e4065b10/components/mus/public/cpp/input_devices/input_device_client.cc [add] https://crrev.com/edbac87b7a0fbe93a323840e2f143686e4065b10/components/mus/public/cpp/input_devices/input_device_client.h [add] https://crrev.com/edbac87b7a0fbe93a323840e2f143686e4065b10/components/mus/public/interfaces/input_devices/BUILD.gn [add] https://crrev.com/edbac87b7a0fbe93a323840e2f143686e4065b10/components/mus/public/interfaces/input_devices/input_device_server.mojom
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6f6a2cb61603a8006b6c6b76ff342ede47acd85b commit 6f6a2cb61603a8006b6c6b76ff342ede47acd85b Author: kylechar <kylechar@chromium.org> Date: Fri Jun 17 14:58:41 2016 Fix InputDevice StructTraits. The StructTraits for InputDevice won't compile due to strict warnings on Chrome OS and not producing an object file on Windows. Fix both of those problems. Also use this change to move the enum switch statements into an EnumTraits and combine the two typemap files into one. BUG= 601981 Review-Url: https://codereview.chromium.org/2069823004 Cr-Commit-Position: refs/heads/master@{#400428} [modify] https://crrev.com/6f6a2cb61603a8006b6c6b76ff342ede47acd85b/ui/events/devices/mojo/input_device.typemap [add] https://crrev.com/6f6a2cb61603a8006b6c6b76ff342ede47acd85b/ui/events/devices/mojo/input_device_struct_traits.cc [modify] https://crrev.com/6f6a2cb61603a8006b6c6b76ff342ede47acd85b/ui/events/devices/mojo/input_device_struct_traits.h [delete] https://crrev.com/bcc64354edb0adfb148e351a0bf701f5fe88745a/ui/events/devices/mojo/touchscreen_device.typemap [modify] https://crrev.com/6f6a2cb61603a8006b6c6b76ff342ede47acd85b/ui/events/devices/mojo/typemaps.gni
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/523bf0ebab6ebdafb419e517666f14aa769bd429 commit 523bf0ebab6ebdafb419e517666f14aa769bd429 Author: kylechar <kylechar@chromium.org> Date: Mon Jun 20 19:17:05 2016 Enable InputDeviceServer/InputDeviceClient in mash. Remove the stub version of DeviceDataManager that is created in the browser and ash processes when running under mash. The stub version never has any input-device information because the real DeviceDataManager is in the mus process. Create InputDeviceClient inside ash and chrome which connects to mus and receives input-device updates via Mojo IPC. The mus process starts InputDeviceServer to listen for observers and update them when new input-device information is available. BUG= 601981 Review-Url: https://codereview.chromium.org/2058853002 Cr-Commit-Position: refs/heads/master@{#400746} [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/ash/sysui/BUILD.gn [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/ash/sysui/sysui_application.cc [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/ash/sysui/sysui_application.h [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/chrome/browser/BUILD.gn [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/components/mus/BUILD.gn [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/components/mus/input_devices/input_device_server.cc [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/components/mus/input_devices/input_device_server.h [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/components/mus/manifest.json [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/components/mus/mus_app.cc [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/components/mus/mus_app.h [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/ui/views/mus/BUILD.gn [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/ui/views/mus/window_manager_connection.cc [modify] https://crrev.com/523bf0ebab6ebdafb419e517666f14aa769bd429/ui/views/mus/window_manager_connection.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b9e61b4b1e0c94947c32d6d74741e0a335f8b981 commit b9e61b4b1e0c94947c32d6d74741e0a335f8b981 Author: kylechar <kylechar@chromium.org> Date: Tue Jun 28 22:15:48 2016 Add tests for InputDevice/TouchscreenDevice StructTraits. Add test to ensure serialization/deserialization produces unchanged InputDevice and TouchScreenDevice objects. BUG= 601981 Review-Url: https://codereview.chromium.org/2100893002 Cr-Commit-Position: refs/heads/master@{#402569} [modify] https://crrev.com/b9e61b4b1e0c94947c32d6d74741e0a335f8b981/ui/events/BUILD.gn [modify] https://crrev.com/b9e61b4b1e0c94947c32d6d74741e0a335f8b981/ui/events/devices/mojo/BUILD.gn [add] https://crrev.com/b9e61b4b1e0c94947c32d6d74741e0a335f8b981/ui/events/devices/mojo/DEPS [add] https://crrev.com/b9e61b4b1e0c94947c32d6d74741e0a335f8b981/ui/events/devices/mojo/device_struct_traits_test.mojom [add] https://crrev.com/b9e61b4b1e0c94947c32d6d74741e0a335f8b981/ui/events/devices/mojo/device_struct_traits_unittest.cc [modify] https://crrev.com/b9e61b4b1e0c94947c32d6d74741e0a335f8b981/ui/events/devices/mojo/input_device_struct_traits.cc [modify] https://crrev.com/b9e61b4b1e0c94947c32d6d74741e0a335f8b981/ui/events/devices/mojo/input_device_struct_traits.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/592104aca7f126817491da88187a2572332f0bfd commit 592104aca7f126817491da88187a2572332f0bfd Author: kylechar <kylechar@chromium.org> Date: Thu Aug 04 15:10:10 2016 Add tests for InputDeviceServer/InputDeviceClient. This CL adds single process tests that trigger device hotplug events and ensure that InputDeviceServer forwards input-device information to InputDeviceClient via Mojo IPC. InputDeviceClient is refactored to not always register itself as the InputDeviceManager. This is to allow tests where DeviceDataManager and one or more InputDeviceClients exist. This functionality is hidden and requires subclassing InputDeviceClient to access. BUG= 601981 Review-Url: https://codereview.chromium.org/2196563004 Cr-Commit-Position: refs/heads/master@{#409787} [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/services/ui/input_devices/BUILD.gn [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/services/ui/input_devices/input_device_server.cc [add] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/services/ui/input_devices/input_device_unittests.cc [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/services/ui/public/cpp/input_devices/BUILD.gn [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/services/ui/public/cpp/input_devices/input_device_client.cc [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/services/ui/public/cpp/input_devices/input_device_client.h [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/testing/buildbot/chromium.chromiumos.json [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/testing/buildbot/chromium.linux.json [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/testing/buildbot/gn_isolate_map.pyl [modify] https://crrev.com/592104aca7f126817491da88187a2572332f0bfd/ui/events/devices/BUILD.gn
The DeviceDataManager (aka InputDeviceManager) half of this service has been implemented with tests (with a few small TODOs left). This leaves the InputController work.
I've opened crbug.com/642863 for the InputController part. Closing this bug as we have a input-device service now.
Comment 1 by kylec...@chromium.org
, Apr 11 2016