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

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

Issue 16114003: Don't send touch move to renderer while scrolling (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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/touch_event_queue.cc
diff --git a/content/browser/renderer_host/touch_event_queue.cc b/content/browser/renderer_host/touch_event_queue.cc
index 4ed87331b8435dd008d0625177a0df53aab20fd9..cffd9784e92599f32d0daacd9daf23011313abf2 100644
--- a/content/browser/renderer_host/touch_event_queue.cc
+++ b/content/browser/renderer_host/touch_event_queue.cc
@@ -169,6 +169,13 @@ void TouchEventQueue::PopTouchEventToView(InputEventAckState ack_result) {
scoped_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front());
touch_queue_.pop_front();
+ WebKit::WebInputEvent::Type event_type = acked_event->coalesced_event().type;
+ if (event_type == WebKit::WebInputEvent::TouchCancel &&
+ render_widget_host_->skip_next_acked_touch_cancel()) {
+ render_widget_host_->skip_next_acked_touch_cancel() = false;
+ return;
+ }
+
// Note that acking the touch-event may result in multiple gestures being sent
// to the renderer.
RenderWidgetHostViewPort* view = RenderWidgetHostViewPort::FromRWHV(
@@ -186,6 +193,11 @@ bool TouchEventQueue::ShouldForwardToRenderer(
if (event.type == WebKit::WebInputEvent::TouchStart)
return true;
+ // If scrolling is in progress, don't sned touch moves to renderer.
+ if (render_widget_host_->scroll_update_in_progress() &&
+ event.type == WebKit::WebInputEvent::TouchMove)
+ return false;
+
for (unsigned int i = 0; i < event.touchesLength; ++i) {
const WebKit::WebTouchPoint& point = event.touches[i];
// If a point has been stationary, then don't take it into account.

Powered by Google App Engine
This is Rietveld 408576698