| 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 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 jfloat pos_x_1, | 898 jfloat pos_x_1, |
| 899 jfloat pos_y_1, | 899 jfloat pos_y_1, |
| 900 jint pointer_id_0, | 900 jint pointer_id_0, |
| 901 jint pointer_id_1, | 901 jint pointer_id_1, |
| 902 jfloat touch_major_0, | 902 jfloat touch_major_0, |
| 903 jfloat touch_major_1, | 903 jfloat touch_major_1, |
| 904 jfloat touch_minor_0, | 904 jfloat touch_minor_0, |
| 905 jfloat touch_minor_1, | 905 jfloat touch_minor_1, |
| 906 jfloat orientation_0, | 906 jfloat orientation_0, |
| 907 jfloat orientation_1, | 907 jfloat orientation_1, |
| 908 jfloat tilt_0, |
| 909 jfloat tilt_1, |
| 908 jfloat raw_pos_x, | 910 jfloat raw_pos_x, |
| 909 jfloat raw_pos_y, | 911 jfloat raw_pos_y, |
| 910 jint android_tool_type_0, | 912 jint android_tool_type_0, |
| 911 jint android_tool_type_1, | 913 jint android_tool_type_1, |
| 912 jint android_button_state, | 914 jint android_button_state, |
| 913 jint android_meta_state, | 915 jint android_meta_state, |
| 914 jboolean is_touch_handle_event) { | 916 jboolean is_touch_handle_event) { |
| 915 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 917 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
| 916 // Avoid synthesizing a touch event if it cannot be forwarded. | 918 // Avoid synthesizing a touch event if it cannot be forwarded. |
| 917 if (!rwhv) | 919 if (!rwhv) |
| 918 return false; | 920 return false; |
| 919 | 921 |
| 920 MotionEventAndroid::Pointer pointer0(pointer_id_0, | 922 MotionEventAndroid::Pointer pointer0(pointer_id_0, |
| 921 pos_x_0, | 923 pos_x_0, |
| 922 pos_y_0, | 924 pos_y_0, |
| 923 touch_major_0, | 925 touch_major_0, |
| 924 touch_minor_0, | 926 touch_minor_0, |
| 925 orientation_0, | 927 orientation_0, |
| 928 tilt_0, |
| 926 android_tool_type_0); | 929 android_tool_type_0); |
| 927 MotionEventAndroid::Pointer pointer1(pointer_id_1, | 930 MotionEventAndroid::Pointer pointer1(pointer_id_1, |
| 928 pos_x_1, | 931 pos_x_1, |
| 929 pos_y_1, | 932 pos_y_1, |
| 930 touch_major_1, | 933 touch_major_1, |
| 931 touch_minor_1, | 934 touch_minor_1, |
| 932 orientation_1, | 935 orientation_1, |
| 936 tilt_1, |
| 933 android_tool_type_1); | 937 android_tool_type_1); |
| 934 MotionEventAndroid event(1.f / dpi_scale(), | 938 MotionEventAndroid event(1.f / dpi_scale(), |
| 935 env, | 939 env, |
| 936 motion_event, | 940 motion_event, |
| 937 time_ms, | 941 time_ms, |
| 938 android_action, | 942 android_action, |
| 939 pointer_count, | 943 pointer_count, |
| 940 history_size, | 944 history_size, |
| 941 action_index, | 945 action_index, |
| 942 android_button_state, | 946 android_button_state, |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 return NULL; | 1480 return NULL; |
| 1477 | 1481 |
| 1478 return view->GetJavaObject().Release(); | 1482 return view->GetJavaObject().Release(); |
| 1479 } | 1483 } |
| 1480 | 1484 |
| 1481 bool RegisterContentViewCore(JNIEnv* env) { | 1485 bool RegisterContentViewCore(JNIEnv* env) { |
| 1482 return RegisterNativesImpl(env); | 1486 return RegisterNativesImpl(env); |
| 1483 } | 1487 } |
| 1484 | 1488 |
| 1485 } // namespace content | 1489 } // namespace content |
| OLD | NEW |