| 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_FORWARDER_H_ |
| 6 #define UI_ANDROID_EVENT_FORWARDER_H_ |
| 7 |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 |
| 10 namespace ui { |
| 11 |
| 12 class ViewAndroid; |
| 13 |
| 14 class EventForwarder { |
| 15 public: |
| 16 ~EventForwarder(); |
| 17 |
| 18 jboolean OnTouchEvent( |
| 19 JNIEnv* env, |
| 20 const base::android::JavaParamRef<jobject>& obj, |
| 21 const base::android::JavaParamRef<jobject>& motion_event, |
| 22 jlong time_ms, |
| 23 jint android_action, |
| 24 jint pointer_count, |
| 25 jint history_size, |
| 26 jint action_index, |
| 27 jfloat pos_x_0, |
| 28 jfloat pos_y_0, |
| 29 jfloat pos_x_1, |
| 30 jfloat pos_y_1, |
| 31 jint pointer_id_0, |
| 32 jint pointer_id_1, |
| 33 jfloat touch_major_0, |
| 34 jfloat touch_major_1, |
| 35 jfloat touch_minor_0, |
| 36 jfloat touch_minor_1, |
| 37 jfloat orientation_0, |
| 38 jfloat orientation_1, |
| 39 jfloat tilt_0, |
| 40 jfloat tilt_1, |
| 41 jfloat raw_pos_x, |
| 42 jfloat raw_pos_y, |
| 43 jint android_tool_type_0, |
| 44 jint android_tool_type_1, |
| 45 jint android_button_state, |
| 46 jint android_meta_state, |
| 47 jboolean is_touch_handle_event); |
| 48 |
| 49 void OnMouseEvent(JNIEnv* env, |
| 50 const base::android::JavaParamRef<jobject>& obj, |
| 51 jlong time_ms, |
| 52 jint android_action, |
| 53 jfloat x, |
| 54 jfloat y, |
| 55 jint pointer_id, |
| 56 jfloat pressure, |
| 57 jfloat orientation, |
| 58 jfloat tilt, |
| 59 jint android_changed_button, |
| 60 jint android_button_state, |
| 61 jint android_meta_state, |
| 62 jint tool_type); |
| 63 |
| 64 private: |
| 65 friend class ViewAndroid; |
| 66 |
| 67 explicit EventForwarder(ViewAndroid* view); |
| 68 |
| 69 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); |
| 70 |
| 71 ViewAndroid* const view_; |
| 72 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(EventForwarder); |
| 75 }; |
| 76 |
| 77 bool RegisterEventForwarder(JNIEnv* env); |
| 78 |
| 79 } // namespace ui |
| 80 |
| 81 #endif // UI_ANDROID_EVENT_FORWARDER_H_ |
| OLD | NEW |