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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 jfloat pos_x_1, | 895 jfloat pos_x_1, |
896 jfloat pos_y_1, | 896 jfloat pos_y_1, |
897 jint pointer_id_0, | 897 jint pointer_id_0, |
898 jint pointer_id_1, | 898 jint pointer_id_1, |
899 jfloat touch_major_0, | 899 jfloat touch_major_0, |
900 jfloat touch_major_1, | 900 jfloat touch_major_1, |
901 jfloat touch_minor_0, | 901 jfloat touch_minor_0, |
902 jfloat touch_minor_1, | 902 jfloat touch_minor_1, |
903 jfloat orientation_0, | 903 jfloat orientation_0, |
904 jfloat orientation_1, | 904 jfloat orientation_1, |
| 905 jfloat tilt_0, |
| 906 jfloat tilt_1, |
905 jfloat raw_pos_x, | 907 jfloat raw_pos_x, |
906 jfloat raw_pos_y, | 908 jfloat raw_pos_y, |
907 jint android_tool_type_0, | 909 jint android_tool_type_0, |
908 jint android_tool_type_1, | 910 jint android_tool_type_1, |
909 jint android_button_state, | 911 jint android_button_state, |
910 jint android_meta_state, | 912 jint android_meta_state, |
911 jboolean is_touch_handle_event) { | 913 jboolean is_touch_handle_event) { |
912 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 914 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
913 // Avoid synthesizing a touch event if it cannot be forwarded. | 915 // Avoid synthesizing a touch event if it cannot be forwarded. |
914 if (!rwhv) | 916 if (!rwhv) |
915 return false; | 917 return false; |
916 | 918 |
917 MotionEventAndroid::Pointer pointer0(pointer_id_0, | 919 MotionEventAndroid::Pointer pointer0(pointer_id_0, |
918 pos_x_0, | 920 pos_x_0, |
919 pos_y_0, | 921 pos_y_0, |
920 touch_major_0, | 922 touch_major_0, |
921 touch_minor_0, | 923 touch_minor_0, |
922 orientation_0, | 924 orientation_0, |
| 925 tilt_0, |
923 android_tool_type_0); | 926 android_tool_type_0); |
924 MotionEventAndroid::Pointer pointer1(pointer_id_1, | 927 MotionEventAndroid::Pointer pointer1(pointer_id_1, |
925 pos_x_1, | 928 pos_x_1, |
926 pos_y_1, | 929 pos_y_1, |
927 touch_major_1, | 930 touch_major_1, |
928 touch_minor_1, | 931 touch_minor_1, |
929 orientation_1, | 932 orientation_1, |
| 933 tilt_1, |
930 android_tool_type_1); | 934 android_tool_type_1); |
931 MotionEventAndroid event(1.f / dpi_scale(), | 935 MotionEventAndroid event(1.f / dpi_scale(), |
932 env, | 936 env, |
933 motion_event, | 937 motion_event, |
934 time_ms, | 938 time_ms, |
935 android_action, | 939 android_action, |
936 pointer_count, | 940 pointer_count, |
937 history_size, | 941 history_size, |
938 action_index, | 942 action_index, |
939 android_button_state, | 943 android_button_state, |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 return NULL; | 1467 return NULL; |
1464 | 1468 |
1465 return view->GetJavaObject().Release(); | 1469 return view->GetJavaObject().Release(); |
1466 } | 1470 } |
1467 | 1471 |
1468 bool RegisterContentViewCore(JNIEnv* env) { | 1472 bool RegisterContentViewCore(JNIEnv* env) { |
1469 return RegisterNativesImpl(env); | 1473 return RegisterNativesImpl(env); |
1470 } | 1474 } |
1471 | 1475 |
1472 } // namespace content | 1476 } // namespace content |
OLD | NEW |