diff options
author | jdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-16 01:34:18 +0000 |
---|---|---|
committer | jdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-16 01:34:18 +0000 |
commit | 57468865628cccb92d8ac3a12cfb578d30e74fef (patch) | |
tree | 8c8bc0ad48636fc6d1a429b974939cd2bd0fdc69 /content/port | |
parent | da94a1e9ba776f886331eab38cd2f0edd97ef352 (diff) | |
download | chromium_src-57468865628cccb92d8ac3a12cfb578d30e74fef.zip chromium_src-57468865628cccb92d8ac3a12cfb578d30e74fef.tar.gz chromium_src-57468865628cccb92d8ac3a12cfb578d30e74fef.tar.bz2 |
Consolidate WebInputEvent coalescing logic
Code for coalescing the various WebInputEvent types is littered throughout the
code. Move all such logic into WebInputEventTraits, making possible standalone
test for event coalescing, and simplifying code that relies on coalescing.
BUG=303238
Review URL: https://codereview.chromium.org/26923002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port')
-rw-r--r-- | content/port/browser/event_with_latency_info.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/content/port/browser/event_with_latency_info.h b/content/port/browser/event_with_latency_info.h index a39ae52..c8d941f 100644 --- a/content/port/browser/event_with_latency_info.h +++ b/content/port/browser/event_with_latency_info.h @@ -7,6 +7,8 @@ #include "ui/events/latency_info.h" +#include "content/common/input/web_input_event_traits.h" + namespace WebKit { class WebGestureEvent; class WebMouseEvent; @@ -26,6 +28,16 @@ class EventWithLatencyInfo { : event(e), latency(l) {} EventWithLatencyInfo() {} + + bool CanCoalesceWith(const EventWithLatencyInfo& other) + const WARN_UNUSED_RESULT { + return WebInputEventTraits::CanCoalesce(other.event, event); + } + + void CoalesceWith(const EventWithLatencyInfo& other) { + WebInputEventTraits::Coalesce(other.event, &event); + latency.MergeWith(other.latency); + } }; typedef EventWithLatencyInfo<WebKit::WebGestureEvent> |