ozone: evdev: Use kernel timestamp from input events for KeyEvents
commitfb76c8e6549d170cbfce4f4a6c33abfb18daf86c
authorrobert.bradford <robert.bradford@intel.com>
Tue, 10 Feb 2015 12:34:01 +0000 (10 04:34 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 10 Feb 2015 12:34:51 +0000 (10 12:34 +0000)
treed5492bda22fa371e0db305e40b53686c11e7abc1
parent5fbc0b379039ca2e177ab36a33ea612b410a40f8
ozone: evdev: Use kernel timestamp from input events for KeyEvents

The input events come from the kernel with a timestamp generated with
CLOCK_MONOTONIC so populate the time_stamp field of the Event with this
event time stamp (in lieu of using EventTimeForNow()).

For key repeats use EventTimeForNow() which also uses CLOCK_MONOTONIC
via TimeTicks::Now().

This change introduces a new constructor to KeyEvent which allows the
provision of a time_stamp and a new helper function to convert
an input_event's time to a base::TimeDelta. This helper is used in the
TouchEventConvertEvdev which was making the same calculation.

BUG=450341
TEST=Interactive testing (in particular key repeat) on link_freon and
events_unittests passes

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

Cr-Commit-Position: refs/heads/master@{#315544}
15 files changed:
chrome/browser/chromeos/input_method/input_method_engine.cc
content/browser/renderer_host/web_input_event_aura_unittest.cc
ui/events/event.cc
ui/events/event.h
ui/events/ozone/evdev/device_event_dispatcher_evdev.cc
ui/events/ozone/evdev/device_event_dispatcher_evdev.h
ui/events/ozone/evdev/event_converter_evdev.cc
ui/events/ozone/evdev/event_converter_evdev.h
ui/events/ozone/evdev/event_converter_evdev_impl.cc
ui/events/ozone/evdev/event_factory_evdev.cc
ui/events/ozone/evdev/input_injector_evdev.cc
ui/events/ozone/evdev/keyboard_evdev.cc
ui/events/ozone/evdev/keyboard_evdev.h
ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
ui/events/ozone/evdev/touch_event_converter_evdev.cc