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

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

Issue 1417803002: Pass MotionEvent tilt angles to Blink on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Flattened nested ifs, fixed a special case Created 5 years, 1 month 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 jfloat pos_x_1, 870 jfloat pos_x_1,
871 jfloat pos_y_1, 871 jfloat pos_y_1,
872 jint pointer_id_0, 872 jint pointer_id_0,
873 jint pointer_id_1, 873 jint pointer_id_1,
874 jfloat touch_major_0, 874 jfloat touch_major_0,
875 jfloat touch_major_1, 875 jfloat touch_major_1,
876 jfloat touch_minor_0, 876 jfloat touch_minor_0,
877 jfloat touch_minor_1, 877 jfloat touch_minor_1,
878 jfloat orientation_0, 878 jfloat orientation_0,
879 jfloat orientation_1, 879 jfloat orientation_1,
880 jfloat tilt_0,
881 jfloat tilt_1,
880 jfloat raw_pos_x, 882 jfloat raw_pos_x,
881 jfloat raw_pos_y, 883 jfloat raw_pos_y,
882 jint android_tool_type_0, 884 jint android_tool_type_0,
883 jint android_tool_type_1, 885 jint android_tool_type_1,
884 jint android_button_state, 886 jint android_button_state,
885 jint android_meta_state, 887 jint android_meta_state,
886 jboolean is_touch_handle_event) { 888 jboolean is_touch_handle_event) {
887 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); 889 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid();
888 // Avoid synthesizing a touch event if it cannot be forwarded. 890 // Avoid synthesizing a touch event if it cannot be forwarded.
889 if (!rwhv) 891 if (!rwhv)
890 return false; 892 return false;
891 893
892 MotionEventAndroid::Pointer pointer0(pointer_id_0, 894 MotionEventAndroid::Pointer pointer0(pointer_id_0,
893 pos_x_0, 895 pos_x_0,
894 pos_y_0, 896 pos_y_0,
895 touch_major_0, 897 touch_major_0,
896 touch_minor_0, 898 touch_minor_0,
897 orientation_0, 899 orientation_0,
900 tilt_0,
898 android_tool_type_0); 901 android_tool_type_0);
899 MotionEventAndroid::Pointer pointer1(pointer_id_1, 902 MotionEventAndroid::Pointer pointer1(pointer_id_1,
900 pos_x_1, 903 pos_x_1,
901 pos_y_1, 904 pos_y_1,
902 touch_major_1, 905 touch_major_1,
903 touch_minor_1, 906 touch_minor_1,
904 orientation_1, 907 orientation_1,
908 tilt_1,
905 android_tool_type_1); 909 android_tool_type_1);
906 MotionEventAndroid event(1.f / dpi_scale(), 910 MotionEventAndroid event(1.f / dpi_scale(),
907 env, 911 env,
908 motion_event, 912 motion_event,
909 time_ms, 913 time_ms,
910 android_action, 914 android_action,
911 pointer_count, 915 pointer_count,
912 history_size, 916 history_size,
913 action_index, 917 action_index,
914 android_button_state, 918 android_button_state,
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 return ScopedJavaLocalRef<jobject>(); 1452 return ScopedJavaLocalRef<jobject>();
1449 1453
1450 return view->GetJavaObject(); 1454 return view->GetJavaObject();
1451 } 1455 }
1452 1456
1453 bool RegisterContentViewCore(JNIEnv* env) { 1457 bool RegisterContentViewCore(JNIEnv* env) {
1454 return RegisterNativesImpl(env); 1458 return RegisterNativesImpl(env);
1455 } 1459 }
1456 1460
1457 } // namespace content 1461 } // 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