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