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

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: rebased 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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 jint action_index, 940 jint action_index,
941 jfloat pos_x_0, 941 jfloat pos_x_0,
942 jfloat pos_y_0, 942 jfloat pos_y_0,
943 jfloat pos_x_1, 943 jfloat pos_x_1,
944 jfloat pos_y_1, 944 jfloat pos_y_1,
945 jint pointer_id_0, 945 jint pointer_id_0,
946 jint pointer_id_1, 946 jint pointer_id_1,
947 jfloat touch_major_0, 947 jfloat touch_major_0,
948 jfloat touch_major_1, 948 jfloat touch_major_1,
949 jfloat raw_pos_x, 949 jfloat raw_pos_x,
950 jfloat raw_pos_y) { 950 jfloat raw_pos_y,
951 jint android_tool_type_0,
952 jint android_tool_type_1,
953 jint android_button_state) {
951 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); 954 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid();
952 // Avoid synthesizing a touch event if it cannot be forwarded. 955 // Avoid synthesizing a touch event if it cannot be forwarded.
953 if (!rwhv) 956 if (!rwhv)
954 return false; 957 return false;
955 958
956 MotionEventAndroid event(1.f / dpi_scale(), 959 MotionEventAndroid event(1.f / dpi_scale(),
957 env, 960 env,
958 motion_event, 961 motion_event,
959 time_ms, 962 time_ms,
960 android_action, 963 android_action,
961 pointer_count, 964 pointer_count,
962 history_size, 965 history_size,
963 action_index, 966 action_index,
964 pos_x_0, 967 pos_x_0,
965 pos_y_0, 968 pos_y_0,
966 pos_x_1, 969 pos_x_1,
967 pos_y_1, 970 pos_y_1,
968 pointer_id_0, 971 pointer_id_0,
969 pointer_id_1, 972 pointer_id_1,
970 touch_major_0, 973 touch_major_0,
971 touch_major_1, 974 touch_major_1,
972 raw_pos_x, 975 raw_pos_x,
973 raw_pos_y); 976 raw_pos_y,
977 android_tool_type_0,
978 android_tool_type_1,
979 android_button_state);
974 980
975 return rwhv->OnTouchEvent(event); 981 return rwhv->OnTouchEvent(event);
976 } 982 }
977 983
978 float ContentViewCoreImpl::GetDpiScale() const { 984 float ContentViewCoreImpl::GetDpiScale() const {
979 return dpi_scale_; 985 return dpi_scale_;
980 } 986 }
981 987
982 jboolean ContentViewCoreImpl::SendMouseMoveEvent(JNIEnv* env, 988 jboolean ContentViewCoreImpl::SendMouseMoveEvent(JNIEnv* env,
983 jobject obj, 989 jobject obj,
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 reinterpret_cast<ui::WindowAndroid*>(window_android), 1628 reinterpret_cast<ui::WindowAndroid*>(window_android),
1623 retained_objects_set); 1629 retained_objects_set);
1624 return reinterpret_cast<intptr_t>(view); 1630 return reinterpret_cast<intptr_t>(view);
1625 } 1631 }
1626 1632
1627 bool RegisterContentViewCore(JNIEnv* env) { 1633 bool RegisterContentViewCore(JNIEnv* env) {
1628 return RegisterNativesImpl(env); 1634 return RegisterNativesImpl(env);
1629 } 1635 }
1630 1636
1631 } // namespace content 1637 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/input/motion_event_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698