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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 724313003: [Android] Always precede Tap gesture events with TapDown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | content/common/input/gesture_event_stream_validator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index b2c2f7a48d3e0e0017b025b7cd27d20ff7018ad9..4697f6b00858eda59fe55c580a22713cff2d7c28 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1028,11 +1028,17 @@ void ContentViewCoreImpl::FlingCancel(JNIEnv* env, jobject obj, jlong time_ms) {
void ContentViewCoreImpl::SingleTap(JNIEnv* env, jobject obj, jlong time_ms,
jfloat x, jfloat y) {
- WebGestureEvent event = MakeGestureEvent(
+ // Tap gestures should always be preceded by a TapDown, ensuring consistency
+ // with the touch-based gesture detection pipeline.
+ WebGestureEvent tap_down_event = MakeGestureEvent(
+ WebInputEvent::GestureTapDown, time_ms, x, y);
Rick Byers 2014/11/17 22:55:24 What about GestureShowPress? Shouldn't Tap always
jdduke (slow) 2014/11/17 23:45:21 Hmm, you tell me :) I believe we insert ShowPress
Zeeshan Qureshi 2014/11/17 23:49:06 I believe Tap is only fired when the finger lifts?
jdduke (slow) 2014/11/17 23:52:20 Well, I think we still want the delay before activ
+ tap_down_event.data.tap.tapCount = 1;
+ SendGestureEvent(tap_down_event);
+
+ WebGestureEvent tap_event = MakeGestureEvent(
WebInputEvent::GestureTap, time_ms, x, y);
- event.data.tap.tapCount = 1;
-
- SendGestureEvent(event);
+ tap_event.data.tap.tapCount = 1;
+ SendGestureEvent(tap_event);
}
void ContentViewCoreImpl::DoubleTap(JNIEnv* env, jobject obj, jlong time_ms,
« no previous file with comments | « no previous file | content/common/input/gesture_event_stream_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698