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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 jint android_tool_type_0, | 879 jint android_tool_type_0, |
880 jint android_tool_type_1, | 880 jint android_tool_type_1, |
881 jint android_button_state, | 881 jint android_button_state, |
882 jint android_meta_state, | 882 jint android_meta_state, |
883 jboolean is_touch_handle_event) { | 883 jboolean is_touch_handle_event) { |
884 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 884 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
885 // Avoid synthesizing a touch event if it cannot be forwarded. | 885 // Avoid synthesizing a touch event if it cannot be forwarded. |
886 if (!rwhv) | 886 if (!rwhv) |
887 return false; | 887 return false; |
888 | 888 |
| 889 MotionEventAndroid::Pointer pointer0(pointer_id_0, |
| 890 pos_x_0, |
| 891 pos_y_0, |
| 892 touch_major_0, |
| 893 touch_minor_0, |
| 894 orientation_0, |
| 895 android_tool_type_0); |
| 896 MotionEventAndroid::Pointer pointer1(pointer_id_1, |
| 897 pos_x_1, |
| 898 pos_y_1, |
| 899 touch_major_1, |
| 900 touch_minor_1, |
| 901 orientation_1, |
| 902 android_tool_type_1); |
889 MotionEventAndroid event(1.f / dpi_scale(), | 903 MotionEventAndroid event(1.f / dpi_scale(), |
890 env, | 904 env, |
891 motion_event, | 905 motion_event, |
892 time_ms, | 906 time_ms, |
893 android_action, | 907 android_action, |
894 pointer_count, | 908 pointer_count, |
895 history_size, | 909 history_size, |
896 action_index, | 910 action_index, |
897 pos_x_0, | 911 raw_pos_x - pos_x_0, |
898 pos_y_0, | 912 raw_pos_y - pos_y_0, |
899 pos_x_1, | |
900 pos_y_1, | |
901 pointer_id_0, | |
902 pointer_id_1, | |
903 touch_major_0, | |
904 touch_major_1, | |
905 touch_minor_0, | |
906 touch_minor_1, | |
907 orientation_0, | |
908 orientation_1, | |
909 raw_pos_x, | |
910 raw_pos_y, | |
911 android_tool_type_0, | |
912 android_tool_type_1, | |
913 android_button_state, | 913 android_button_state, |
914 android_meta_state); | 914 android_meta_state, |
| 915 pointer0, |
| 916 pointer1); |
915 | 917 |
916 return is_touch_handle_event ? rwhv->OnTouchHandleEvent(event) | 918 return is_touch_handle_event ? rwhv->OnTouchHandleEvent(event) |
917 : rwhv->OnTouchEvent(event); | 919 : rwhv->OnTouchEvent(event); |
918 } | 920 } |
919 | 921 |
920 float ContentViewCoreImpl::GetDpiScale() const { | 922 float ContentViewCoreImpl::GetDpiScale() const { |
921 return dpi_scale_; | 923 return dpi_scale_; |
922 } | 924 } |
923 | 925 |
924 jboolean ContentViewCoreImpl::SendMouseMoveEvent(JNIEnv* env, | 926 jboolean ContentViewCoreImpl::SendMouseMoveEvent(JNIEnv* env, |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1340 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1339 retained_objects_set); | 1341 retained_objects_set); |
1340 return reinterpret_cast<intptr_t>(view); | 1342 return reinterpret_cast<intptr_t>(view); |
1341 } | 1343 } |
1342 | 1344 |
1343 bool RegisterContentViewCore(JNIEnv* env) { | 1345 bool RegisterContentViewCore(JNIEnv* env) { |
1344 return RegisterNativesImpl(env); | 1346 return RegisterNativesImpl(env); |
1345 } | 1347 } |
1346 | 1348 |
1347 } // namespace content | 1349 } // namespace content |
OLD | NEW |