ozone: evdev: Keep track of settings & apply to new devices
commit8ec6aaa574230d326a602f1cd719cfff227e4279
authorspang <spang@chromium.org>
Tue, 24 Feb 2015 19:24:52 +0000 (24 11:24 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 24 Feb 2015 19:25:37 +0000 (24 19:25 +0000)
treee47254ffb69f1cec0b2c0ebaccc2b8727dee5e96
parent615f8232af4ae7be355c2951b93a39d0d06d1cc8
ozone: evdev: Keep track of settings & apply to new devices

This closes two large holes in the settings code:

(1) Any changes made before the input device thread starts are lost.
(2) Settings are not internally applied to new devices on hotplug.

In theory these problems should not have mattered because there is a
DeviceChangeHandler class to watch for new devices & reapply settings
whenever a new device appears. However, in practice that class is not
actually instantiated. We've had several reports of settings not being
properly applied.

To fix (1) build up desired settings state on the UI thread in
InputControllerEvdev, and push it to InputDeviceFactoryEvdev once the
thread starts.

To fix (2) keep the desired settings state on InputDeviceFactoryEvdev,
and reapply settings on hotplug.

BUG=451743
TEST=Turned on australian scrolling & ran "sudo restart udev" on
     link_freon. Verified scrolling is still australian.

Review URL: https://codereview.chromium.org/951063004

Cr-Commit-Position: refs/heads/master@{#317851}
ui/events/ozone/BUILD.gn
ui/events/ozone/evdev/event_factory_evdev.cc
ui/events/ozone/evdev/input_controller_evdev.cc
ui/events/ozone/evdev/input_controller_evdev.h
ui/events/ozone/evdev/input_device_factory_evdev.cc
ui/events/ozone/evdev/input_device_factory_evdev.h
ui/events/ozone/evdev/input_device_factory_evdev_proxy.cc
ui/events/ozone/evdev/input_device_factory_evdev_proxy.h
ui/events/ozone/evdev/input_device_settings_evdev.cc [new file with mode: 0644]
ui/events/ozone/evdev/input_device_settings_evdev.h [new file with mode: 0644]
ui/events/ozone/events_ozone.gyp