From 57468865628cccb92d8ac3a12cfb578d30e74fef Mon Sep 17 00:00:00 2001 From: "jdduke@chromium.org" Date: Wed, 16 Oct 2013 01:34:18 +0000 Subject: 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 --- content/port/browser/event_with_latency_info.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'content/port') 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 -- cgit v1.1