Index: content/browser/renderer_host/render_widget_host_view_android.cc |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
index 3a2dc883f4031ea824c2b2088f2d1ecfceae9ecb..ff1385a79f4425238618ded9abb52dc528fdd560 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
@@ -739,12 +739,13 @@ bool RenderWidgetHostViewAndroid::OnTouchHandleEvent( |
void RenderWidgetHostViewAndroid::ResetGestureDetection() { |
const ui::MotionEvent* current_down_event = |
gesture_provider_.GetCurrentDownEvent(); |
- if (!current_down_event) |
- return; |
+ if (current_down_event) { |
+ scoped_ptr<ui::MotionEvent> cancel_event = current_down_event->Cancel(); |
+ OnTouchEvent(*cancel_event); |
+ } |
- scoped_ptr<ui::MotionEvent> cancel_event = current_down_event->Cancel(); |
- DCHECK(cancel_event); |
- OnTouchEvent(*cancel_event); |
+ // A hard reset ensures prevention of any timer-based events. |
+ gesture_provider_.ResetDetection(); |
} |
void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { |