OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1021 } | 1021 } |
1022 | 1022 |
1023 void ContentViewCoreImpl::FlingCancel(JNIEnv* env, jobject obj, jlong time_ms) { | 1023 void ContentViewCoreImpl::FlingCancel(JNIEnv* env, jobject obj, jlong time_ms) { |
1024 WebGestureEvent event = MakeGestureEvent( | 1024 WebGestureEvent event = MakeGestureEvent( |
1025 WebInputEvent::GestureFlingCancel, time_ms, 0, 0); | 1025 WebInputEvent::GestureFlingCancel, time_ms, 0, 0); |
1026 SendGestureEvent(event); | 1026 SendGestureEvent(event); |
1027 } | 1027 } |
1028 | 1028 |
1029 void ContentViewCoreImpl::SingleTap(JNIEnv* env, jobject obj, jlong time_ms, | 1029 void ContentViewCoreImpl::SingleTap(JNIEnv* env, jobject obj, jlong time_ms, |
1030 jfloat x, jfloat y) { | 1030 jfloat x, jfloat y) { |
1031 WebGestureEvent event = MakeGestureEvent( | 1031 // Tap gestures should always be preceded by a TapDown, ensuring consistency |
1032 // with the touch-based gesture detection pipeline. | |
1033 WebGestureEvent tap_down_event = MakeGestureEvent( | |
1034 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
| |
1035 tap_down_event.data.tap.tapCount = 1; | |
1036 SendGestureEvent(tap_down_event); | |
1037 | |
1038 WebGestureEvent tap_event = MakeGestureEvent( | |
1032 WebInputEvent::GestureTap, time_ms, x, y); | 1039 WebInputEvent::GestureTap, time_ms, x, y); |
1033 event.data.tap.tapCount = 1; | 1040 tap_event.data.tap.tapCount = 1; |
1034 | 1041 SendGestureEvent(tap_event); |
1035 SendGestureEvent(event); | |
1036 } | 1042 } |
1037 | 1043 |
1038 void ContentViewCoreImpl::DoubleTap(JNIEnv* env, jobject obj, jlong time_ms, | 1044 void ContentViewCoreImpl::DoubleTap(JNIEnv* env, jobject obj, jlong time_ms, |
1039 jfloat x, jfloat y) { | 1045 jfloat x, jfloat y) { |
1040 WebGestureEvent event = MakeGestureEvent( | 1046 WebGestureEvent event = MakeGestureEvent( |
1041 WebInputEvent::GestureDoubleTap, time_ms, x, y); | 1047 WebInputEvent::GestureDoubleTap, time_ms, x, y); |
1042 // Set the tap count to 1 even for DoubleTap, in order to be consistent with | 1048 // Set the tap count to 1 even for DoubleTap, in order to be consistent with |
1043 // double tap behavior on a mobile viewport. See crbug.com/234986 for context. | 1049 // double tap behavior on a mobile viewport. See crbug.com/234986 for context. |
1044 event.data.tap.tapCount = 1; | 1050 event.data.tap.tapCount = 1; |
1045 | 1051 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1333 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1339 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1334 retained_objects_set); | 1340 retained_objects_set); |
1335 return reinterpret_cast<intptr_t>(view); | 1341 return reinterpret_cast<intptr_t>(view); |
1336 } | 1342 } |
1337 | 1343 |
1338 bool RegisterContentViewCore(JNIEnv* env) { | 1344 bool RegisterContentViewCore(JNIEnv* env) { |
1339 return RegisterNativesImpl(env); | 1345 return RegisterNativesImpl(env); |
1340 } | 1346 } |
1341 | 1347 |
1342 } // namespace content | 1348 } // namespace content |
OLD | NEW |