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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 jint android_tool_type_0, | 859 jint android_tool_type_0, |
860 jint android_tool_type_1, | 860 jint android_tool_type_1, |
861 jint android_button_state, | 861 jint android_button_state, |
862 jint android_meta_state, | 862 jint android_meta_state, |
863 jboolean is_touch_handle_event) { | 863 jboolean is_touch_handle_event) { |
864 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 864 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
865 // Avoid synthesizing a touch event if it cannot be forwarded. | 865 // Avoid synthesizing a touch event if it cannot be forwarded. |
866 if (!rwhv) | 866 if (!rwhv) |
867 return false; | 867 return false; |
868 | 868 |
| 869 MotionEventAndroid::Pointer pointer0(pointer_id_0, |
| 870 pos_x_0, |
| 871 pos_y_0, |
| 872 touch_major_0, |
| 873 touch_minor_0, |
| 874 orientation_0, |
| 875 android_tool_type_0); |
| 876 MotionEventAndroid::Pointer pointer1(pointer_id_1, |
| 877 pos_x_1, |
| 878 pos_y_1, |
| 879 touch_major_1, |
| 880 touch_minor_1, |
| 881 orientation_1, |
| 882 android_tool_type_1); |
869 MotionEventAndroid event(1.f / dpi_scale(), | 883 MotionEventAndroid event(1.f / dpi_scale(), |
870 env, | 884 env, |
871 motion_event, | 885 motion_event, |
872 time_ms, | 886 time_ms, |
873 android_action, | 887 android_action, |
874 pointer_count, | 888 pointer_count, |
875 history_size, | 889 history_size, |
876 action_index, | 890 action_index, |
877 pos_x_0, | |
878 pos_y_0, | |
879 pos_x_1, | |
880 pos_y_1, | |
881 pointer_id_0, | |
882 pointer_id_1, | |
883 touch_major_0, | |
884 touch_major_1, | |
885 touch_minor_0, | |
886 touch_minor_1, | |
887 orientation_0, | |
888 orientation_1, | |
889 raw_pos_x, | |
890 raw_pos_y, | |
891 android_tool_type_0, | |
892 android_tool_type_1, | |
893 android_button_state, | 891 android_button_state, |
894 android_meta_state); | 892 android_meta_state, |
| 893 raw_pos_x - pos_x_0, |
| 894 raw_pos_y - pos_y_0, |
| 895 pointer0, |
| 896 pointer1); |
895 | 897 |
896 return is_touch_handle_event ? rwhv->OnTouchHandleEvent(event) | 898 return is_touch_handle_event ? rwhv->OnTouchHandleEvent(event) |
897 : rwhv->OnTouchEvent(event); | 899 : rwhv->OnTouchEvent(event); |
898 } | 900 } |
899 | 901 |
900 float ContentViewCoreImpl::GetDpiScale() const { | 902 float ContentViewCoreImpl::GetDpiScale() const { |
901 return dpi_scale_; | 903 return dpi_scale_; |
902 } | 904 } |
903 | 905 |
904 jboolean ContentViewCoreImpl::SendMouseMoveEvent(JNIEnv* env, | 906 jboolean ContentViewCoreImpl::SendMouseMoveEvent(JNIEnv* env, |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1305 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1304 retained_objects_set); | 1306 retained_objects_set); |
1305 return reinterpret_cast<intptr_t>(view); | 1307 return reinterpret_cast<intptr_t>(view); |
1306 } | 1308 } |
1307 | 1309 |
1308 bool RegisterContentViewCore(JNIEnv* env) { | 1310 bool RegisterContentViewCore(JNIEnv* env) { |
1309 return RegisterNativesImpl(env); | 1311 return RegisterNativesImpl(env); |
1310 } | 1312 } |
1311 | 1313 |
1312 } // namespace content | 1314 } // namespace content |
OLD | NEW |