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 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 jint history_size, | 929 jint history_size, |
930 jint action_index, | 930 jint action_index, |
931 jfloat pos_x_0, | 931 jfloat pos_x_0, |
932 jfloat pos_y_0, | 932 jfloat pos_y_0, |
933 jfloat pos_x_1, | 933 jfloat pos_x_1, |
934 jfloat pos_y_1, | 934 jfloat pos_y_1, |
935 jint pointer_id_0, | 935 jint pointer_id_0, |
936 jint pointer_id_1, | 936 jint pointer_id_1, |
937 jfloat touch_major_0, | 937 jfloat touch_major_0, |
938 jfloat touch_major_1, | 938 jfloat touch_major_1, |
939 jfloat touch_minor_0, | |
940 jfloat touch_minor_1, | |
941 jfloat orientation_0, | |
942 jfloat orientation_1, | |
943 jfloat raw_pos_x, | 939 jfloat raw_pos_x, |
944 jfloat raw_pos_y, | 940 jfloat raw_pos_y, |
945 jint android_tool_type_0, | 941 jint android_tool_type_0, |
946 jint android_tool_type_1, | 942 jint android_tool_type_1, |
947 jint android_button_state, | 943 jint android_button_state, |
948 jboolean is_touch_handle_event) { | 944 jboolean is_touch_handle_event) { |
949 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 945 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
950 // Avoid synthesizing a touch event if it cannot be forwarded. | 946 // Avoid synthesizing a touch event if it cannot be forwarded. |
951 if (!rwhv) | 947 if (!rwhv) |
952 return false; | 948 return false; |
953 | 949 |
954 MotionEventAndroid event(1.f / dpi_scale(), | 950 MotionEventAndroid event(1.f / dpi_scale(), |
955 env, | 951 env, |
956 motion_event, | 952 motion_event, |
957 time_ms, | 953 time_ms, |
958 android_action, | 954 android_action, |
959 pointer_count, | 955 pointer_count, |
960 history_size, | 956 history_size, |
961 action_index, | 957 action_index, |
962 pos_x_0, | 958 pos_x_0, |
963 pos_y_0, | 959 pos_y_0, |
964 pos_x_1, | 960 pos_x_1, |
965 pos_y_1, | 961 pos_y_1, |
966 pointer_id_0, | 962 pointer_id_0, |
967 pointer_id_1, | 963 pointer_id_1, |
968 touch_major_0, | 964 touch_major_0, |
969 touch_major_1, | 965 touch_major_1, |
970 touch_minor_0, | |
971 touch_minor_1, | |
972 orientation_0, | |
973 orientation_1, | |
974 raw_pos_x, | 966 raw_pos_x, |
975 raw_pos_y, | 967 raw_pos_y, |
976 android_tool_type_0, | 968 android_tool_type_0, |
977 android_tool_type_1, | 969 android_tool_type_1, |
978 android_button_state); | 970 android_button_state); |
979 | 971 |
980 return is_touch_handle_event ? rwhv->OnTouchHandleEvent(event) | 972 return is_touch_handle_event ? rwhv->OnTouchHandleEvent(event) |
981 : rwhv->OnTouchEvent(event); | 973 : rwhv->OnTouchEvent(event); |
982 } | 974 } |
983 | 975 |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1516 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1525 retained_objects_set); | 1517 retained_objects_set); |
1526 return reinterpret_cast<intptr_t>(view); | 1518 return reinterpret_cast<intptr_t>(view); |
1527 } | 1519 } |
1528 | 1520 |
1529 bool RegisterContentViewCore(JNIEnv* env) { | 1521 bool RegisterContentViewCore(JNIEnv* env) { |
1530 return RegisterNativesImpl(env); | 1522 return RegisterNativesImpl(env); |
1531 } | 1523 } |
1532 | 1524 |
1533 } // namespace content | 1525 } // namespace content |
OLD | NEW |