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

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

Issue 717573004: [Android] Thoroughly reset gesture detection upon page navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment Created 6 years, 1 month 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
« no previous file with comments | « no previous file | ui/events/gesture_detection/filtered_gesture_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | ui/events/gesture_detection/filtered_gesture_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698