OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 if (GetRenderWidgetHostViewAndroid()) | 888 if (GetRenderWidgetHostViewAndroid()) |
889 GetRenderWidgetHostViewAndroid()->SendGestureEvent(event); | 889 GetRenderWidgetHostViewAndroid()->SendGestureEvent(event); |
890 } | 890 } |
891 | 891 |
892 void ContentViewCoreImpl::FlingStart(JNIEnv* env, jobject obj, jlong time_ms, | 892 void ContentViewCoreImpl::FlingStart(JNIEnv* env, jobject obj, jlong time_ms, |
893 jint x, jint y, jint vx, jint vy) { | 893 jint x, jint y, jint vx, jint vy) { |
894 WebGestureEvent event = MakeGestureEvent( | 894 WebGestureEvent event = MakeGestureEvent( |
895 WebInputEvent::GestureFlingStart, time_ms, x, y); | 895 WebInputEvent::GestureFlingStart, time_ms, x, y); |
896 event.data.flingStart.velocityX = vx / DpiScale(); | 896 event.data.flingStart.velocityX = vx / DpiScale(); |
897 event.data.flingStart.velocityY = vy / DpiScale(); | 897 event.data.flingStart.velocityY = vy / DpiScale(); |
898 // FIXME(mohsen || rjkroege): Remove following line after removing uses of | |
899 // flingStart.sourceDevice in WebKit, but before removing the field itself. | |
900 event.data.flingStart.sourceDevice = WebGestureEvent::Touchscreen; | |
901 | 898 |
902 if (GetRenderWidgetHostViewAndroid()) | 899 if (GetRenderWidgetHostViewAndroid()) |
903 GetRenderWidgetHostViewAndroid()->SendGestureEvent(event); | 900 GetRenderWidgetHostViewAndroid()->SendGestureEvent(event); |
904 } | 901 } |
905 | 902 |
906 void ContentViewCoreImpl::FlingCancel(JNIEnv* env, jobject obj, jlong time_ms) { | 903 void ContentViewCoreImpl::FlingCancel(JNIEnv* env, jobject obj, jlong time_ms) { |
907 WebGestureEvent event = MakeGestureEvent( | 904 WebGestureEvent event = MakeGestureEvent( |
908 WebInputEvent::GestureFlingCancel, time_ms, 0, 0); | 905 WebInputEvent::GestureFlingCancel, time_ms, 0, 0); |
909 if (GetRenderWidgetHostViewAndroid()) | 906 if (GetRenderWidgetHostViewAndroid()) |
910 GetRenderWidgetHostViewAndroid()->SendGestureEvent(event); | 907 GetRenderWidgetHostViewAndroid()->SendGestureEvent(event); |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 1304 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
1308 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 1305 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
1309 return false; | 1306 return false; |
1310 } | 1307 } |
1311 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 1308 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
1312 | 1309 |
1313 return RegisterNativesImpl(env) >= 0; | 1310 return RegisterNativesImpl(env) >= 0; |
1314 } | 1311 } |
1315 | 1312 |
1316 } // namespace content | 1313 } // namespace content |
OLD | NEW |