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

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: put in RenderWidgetHostViewAura 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..75b9df1b453ba8426aff8f04e90ae630b2469f1c 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(
+ blink::WebTouchEvent* event, int touch_id) {
+ if (event->type == blink::WebInputEvent::TouchMove
+ || event->type == blink::WebInputEvent::TouchCancel) {
tdresser 2015/05/06 11:58:18 Why TouchMove and TouchCancel? Can't this occur wi
jdduke (slow) 2015/05/06 15:23:45 I don't think we will ever generate multiple press
tdresser 2015/05/06 15:28:34 Right, thanks. Do we generate multiple cancel poi
lanwei 2015/05/07 02:37:56 For touchstart and touchend, because motion_event
tdresser 2015/05/07 12:13:06 Acknowledged.
+ size_t index = static_cast<int>(pointer_state_.GetIndexFromId(touch_id));
tdresser 2015/05/06 11:58:18 I'm a bit uneasy about relying on the fact that we
jdduke (slow) 2015/05/06 15:23:45 +1
lanwei 2015/05/07 02:37:56 You are right, index is not safe, I am using touch
+ for (size_t i = 0; i < event->touchesLength; ++i) {
+ if (i != index)
+ 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());
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | ui/events/gestures/motion_event_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698