Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 1120293003: Make sure send one WebTouchEvent ack per ui::TouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use touch_id and add unittest Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index fd85fcc8745cdf59c93e87322518bda129aff961..e9fcf673898ea5d9680a15e12da4250af03d6813 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -805,6 +805,18 @@ void RenderWidgetHostViewAura::ParentHierarchyChanged() {
HandleParentBoundsChanged();
}
+void RenderWidgetHostViewAura::SetTouchPointStateStationary(
jdduke (slow) 2015/05/07 15:20:28 Hmm, ideally this would just be a free, nonmember
lanwei 2015/05/08 02:12:32 Because I need to use this function in the unittes
jdduke (slow) 2015/05/08 02:20:32 Yeah, noticed that later, let's see what Tim says
+ blink::WebTouchEvent* event,
+ int touch_id) {
jdduke (slow) 2015/05/07 15:20:28 Maybe |changed_touch_id|?
lanwei 2015/05/08 02:12:32 Done.
+ if (event->type == blink::WebInputEvent::TouchMove ||
+ event->type == blink::WebInputEvent::TouchCancel) {
+ for (size_t i = 0; i < event->touchesLength; ++i) {
+ if (event->touches[i].id != touch_id)
+ event->touches[i].state = blink::WebTouchPoint::StateStationary;
+ }
+ }
+}
+
void RenderWidgetHostViewAura::MovePluginWindows(
const std::vector<WebPluginGeometry>& plugin_window_moves) {
#if defined(OS_WIN)
@@ -2184,6 +2196,10 @@ void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) {
// processed by the gesture recognizer before events currently awaiting
// dispatch in the touch queue.
event->DisableSynchronousHandling();
+
+ // Set unchange touch point to StateStationary for touchmove and
+ // touchcancel to make sure only send one ack per WebTouchEvent.
+ SetTouchPointStateStationary(&touch_event, event->touch_id());
host_->ForwardTouchEventWithLatencyInfo(touch_event, *event->latency());
}

Powered by Google App Engine
This is Rietveld 408576698