Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 348813002: Extend MotionEvent to have tool type and button state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 jint action_index, 939 jint action_index,
940 jfloat pos_x_0, 940 jfloat pos_x_0,
941 jfloat pos_y_0, 941 jfloat pos_y_0,
942 jfloat pos_x_1, 942 jfloat pos_x_1,
943 jfloat pos_y_1, 943 jfloat pos_y_1,
944 jint pointer_id_0, 944 jint pointer_id_0,
945 jint pointer_id_1, 945 jint pointer_id_1,
946 jfloat touch_major_0, 946 jfloat touch_major_0,
947 jfloat touch_major_1, 947 jfloat touch_major_1,
948 jfloat raw_pos_x, 948 jfloat raw_pos_x,
949 jfloat raw_pos_y) { 949 jfloat raw_pos_y,
950 jint android_tool_type_0,
951 jint android_tool_type_1,
952 jint android_button_state) {
950 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); 953 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid();
951 // Avoid synthesizing a touch event if it cannot be forwarded. 954 // Avoid synthesizing a touch event if it cannot be forwarded.
952 if (!rwhv) 955 if (!rwhv)
953 return false; 956 return false;
954 957
955 MotionEventAndroid event(1.f / dpi_scale(), 958 MotionEventAndroid event(1.f / dpi_scale(),
956 env, 959 env,
957 motion_event, 960 motion_event,
958 time_ms, 961 time_ms,
959 android_action, 962 android_action,
960 pointer_count, 963 pointer_count,
961 history_size, 964 history_size,
962 action_index, 965 action_index,
963 pos_x_0, 966 pos_x_0,
964 pos_y_0, 967 pos_y_0,
965 pos_x_1, 968 pos_x_1,
966 pos_y_1, 969 pos_y_1,
967 pointer_id_0, 970 pointer_id_0,
968 pointer_id_1, 971 pointer_id_1,
969 touch_major_0, 972 touch_major_0,
970 touch_major_1, 973 touch_major_1,
971 raw_pos_x, 974 raw_pos_x,
972 raw_pos_y); 975 raw_pos_y,
976 android_tool_type_0,
977 android_tool_type_1,
978 android_button_state);
973 979
974 return rwhv->OnTouchEvent(event); 980 return rwhv->OnTouchEvent(event);
975 } 981 }
976 982
977 float ContentViewCoreImpl::GetDpiScale() const { 983 float ContentViewCoreImpl::GetDpiScale() const {
978 return dpi_scale_; 984 return dpi_scale_;
979 } 985 }
980 986
981 jboolean ContentViewCoreImpl::SendMouseMoveEvent(JNIEnv* env, 987 jboolean ContentViewCoreImpl::SendMouseMoveEvent(JNIEnv* env,
982 jobject obj, 988 jobject obj,
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 reinterpret_cast<ui::WindowAndroid*>(window_android), 1610 reinterpret_cast<ui::WindowAndroid*>(window_android),
1605 retained_objects_set); 1611 retained_objects_set);
1606 return reinterpret_cast<intptr_t>(view); 1612 return reinterpret_cast<intptr_t>(view);
1607 } 1613 }
1608 1614
1609 bool RegisterContentViewCore(JNIEnv* env) { 1615 bool RegisterContentViewCore(JNIEnv* env) {
1610 return RegisterNativesImpl(env); 1616 return RegisterNativesImpl(env);
1611 } 1617 }
1612 1618
1613 } // namespace content 1619 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698