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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 WebInputEvent::GestureFlingStart, time_ms, x, y); | 1015 WebInputEvent::GestureFlingStart, time_ms, x, y); |
1016 event.data.flingStart.velocityX = vx / dpi_scale(); | 1016 event.data.flingStart.velocityX = vx / dpi_scale(); |
1017 event.data.flingStart.velocityY = vy / dpi_scale(); | 1017 event.data.flingStart.velocityY = vy / dpi_scale(); |
1018 | 1018 |
1019 SendGestureEvent(event); | 1019 SendGestureEvent(event); |
1020 } | 1020 } |
1021 | 1021 |
1022 void ContentViewCoreImpl::FlingCancel(JNIEnv* env, jobject obj, jlong time_ms) { | 1022 void ContentViewCoreImpl::FlingCancel(JNIEnv* env, jobject obj, jlong time_ms) { |
1023 WebGestureEvent event = MakeGestureEvent( | 1023 WebGestureEvent event = MakeGestureEvent( |
1024 WebInputEvent::GestureFlingCancel, time_ms, 0, 0); | 1024 WebInputEvent::GestureFlingCancel, time_ms, 0, 0); |
| 1025 event.data.flingCancel.preventBoosting = true; |
| 1026 |
1025 SendGestureEvent(event); | 1027 SendGestureEvent(event); |
1026 } | 1028 } |
1027 | 1029 |
1028 void ContentViewCoreImpl::SingleTap(JNIEnv* env, jobject obj, jlong time_ms, | 1030 void ContentViewCoreImpl::SingleTap(JNIEnv* env, jobject obj, jlong time_ms, |
1029 jfloat x, jfloat y) { | 1031 jfloat x, jfloat y) { |
1030 // Tap gestures should always be preceded by a TapDown, ensuring consistency | 1032 // Tap gestures should always be preceded by a TapDown, ensuring consistency |
1031 // with the touch-based gesture detection pipeline. | 1033 // with the touch-based gesture detection pipeline. |
1032 WebGestureEvent tap_down_event = MakeGestureEvent( | 1034 WebGestureEvent tap_down_event = MakeGestureEvent( |
1033 WebInputEvent::GestureTapDown, time_ms, x, y); | 1035 WebInputEvent::GestureTapDown, time_ms, x, y); |
1034 tap_down_event.data.tap.tapCount = 1; | 1036 tap_down_event.data.tap.tapCount = 1; |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1340 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1339 retained_objects_set); | 1341 retained_objects_set); |
1340 return reinterpret_cast<intptr_t>(view); | 1342 return reinterpret_cast<intptr_t>(view); |
1341 } | 1343 } |
1342 | 1344 |
1343 bool RegisterContentViewCore(JNIEnv* env) { | 1345 bool RegisterContentViewCore(JNIEnv* env) { |
1344 return RegisterNativesImpl(env); | 1346 return RegisterNativesImpl(env); |
1345 } | 1347 } |
1346 | 1348 |
1347 } // namespace content | 1349 } // namespace content |
OLD | NEW |