| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_ANDROID_EVENT_HANDLER_H_ |
| 6 #define UI_ANDROID_EVENT_HANDLER_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "ui/android/ui_android_export.h" |
| 12 |
| 13 namespace ui { |
| 14 |
| 15 class ViewAndroid; |
| 16 |
| 17 class UI_ANDROID_EXPORT EventHandler { |
| 18 public: |
| 19 EventHandler(); |
| 20 base::android::ScopedJavaLocalRef<jobject> CreateJavaObject(); |
| 21 |
| 22 static EventHandler* Create(ViewAndroid* view); |
| 23 |
| 24 jboolean OnTouchEvent( |
| 25 JNIEnv* env, |
| 26 const base::android::JavaParamRef<jobject>& obj, |
| 27 const base::android::JavaParamRef<jobject>& motion_event, |
| 28 jlong time_ms, |
| 29 jint android_action, |
| 30 jint pointer_count, |
| 31 jint history_size, |
| 32 jint action_index, |
| 33 jfloat pos_x_0, |
| 34 jfloat pos_y_0, |
| 35 jfloat pos_x_1, |
| 36 jfloat pos_y_1, |
| 37 jint pointer_id_0, |
| 38 jint pointer_id_1, |
| 39 jfloat touch_major_0, |
| 40 jfloat touch_major_1, |
| 41 jfloat touch_minor_0, |
| 42 jfloat touch_minor_1, |
| 43 jfloat orientation_0, |
| 44 jfloat orientation_1, |
| 45 jfloat tilt_0, |
| 46 jfloat tilt_1, |
| 47 jfloat raw_pos_x, |
| 48 jfloat raw_pos_y, |
| 49 jint android_tool_type_0, |
| 50 jint android_tool_type_1, |
| 51 jint android_button_state, |
| 52 jint android_meta_state, |
| 53 jboolean is_touch_handle_event); |
| 54 |
| 55 jboolean OnMouseEvent(JNIEnv* env, |
| 56 const base::android::JavaParamRef<jobject>& obj, |
| 57 jlong time_ms, |
| 58 jint android_action, |
| 59 jfloat x, |
| 60 jfloat y, |
| 61 jint pointer_id, |
| 62 jfloat pressure, |
| 63 jfloat orientation, |
| 64 jfloat tilt, |
| 65 jint android_changed_button, |
| 66 jint android_button_state, |
| 67 jint android_meta_state, |
| 68 jint tool_type); |
| 69 |
| 70 private: |
| 71 explicit EventHandler(ViewAndroid* view); |
| 72 |
| 73 ViewAndroid* const view_; |
| 74 float dip_scale_; |
| 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(EventHandler); |
| 77 }; |
| 78 |
| 79 bool RegisterEventHandler(JNIEnv* env); |
| 80 |
| 81 } // namespace ui |
| 82 |
| 83 #endif // UI_ANDROID_EVENT_HANDLER_H_ |
| OLD | NEW |