Chromium Code Reviews| 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 "base/android/scoped_java_ref.h" | |
| 9 #include "ui/android/ui_android_export.h" | |
| 10 | |
| 11 namespace ui { | |
| 12 | |
| 13 class ViewAndroid; | |
| 14 | |
| 15 class UI_ANDROID_EXPORT EventHandler { | |
|
boliu
2017/03/03 22:01:32
I think now that the native side EventHandler is n
Jinsuk Kim
2017/03/06 04:07:33
Done.
| |
| 16 public: | |
| 17 explicit EventHandler(ViewAndroid* view); | |
| 18 ~EventHandler(); | |
| 19 | |
| 20 jboolean OnTouchEvent( | |
| 21 JNIEnv* env, | |
| 22 const base::android::JavaParamRef<jobject>& obj, | |
| 23 const base::android::JavaParamRef<jobject>& motion_event, | |
| 24 jlong time_ms, | |
| 25 jint android_action, | |
| 26 jint pointer_count, | |
| 27 jint history_size, | |
| 28 jint action_index, | |
| 29 jfloat pos_x_0, | |
| 30 jfloat pos_y_0, | |
| 31 jfloat pos_x_1, | |
| 32 jfloat pos_y_1, | |
| 33 jint pointer_id_0, | |
| 34 jint pointer_id_1, | |
| 35 jfloat touch_major_0, | |
| 36 jfloat touch_major_1, | |
| 37 jfloat touch_minor_0, | |
| 38 jfloat touch_minor_1, | |
| 39 jfloat orientation_0, | |
| 40 jfloat orientation_1, | |
| 41 jfloat tilt_0, | |
| 42 jfloat tilt_1, | |
| 43 jfloat raw_pos_x, | |
| 44 jfloat raw_pos_y, | |
| 45 jint android_tool_type_0, | |
| 46 jint android_tool_type_1, | |
| 47 jint android_button_state, | |
| 48 jint android_meta_state, | |
| 49 jboolean is_touch_handle_event); | |
| 50 | |
| 51 void OnMouseEvent(JNIEnv* env, | |
| 52 const base::android::JavaParamRef<jobject>& obj, | |
| 53 jlong time_ms, | |
| 54 jint android_action, | |
| 55 jfloat x, | |
| 56 jfloat y, | |
| 57 jint pointer_id, | |
| 58 jfloat pressure, | |
| 59 jfloat orientation, | |
| 60 jfloat tilt, | |
| 61 jint android_changed_button, | |
| 62 jint android_button_state, | |
| 63 jint android_meta_state, | |
| 64 jint tool_type); | |
| 65 | |
| 66 private: | |
| 67 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); | |
| 68 | |
| 69 ViewAndroid* const view_; | |
| 70 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | |
| 71 | |
| 72 friend class ViewAndroid; | |
|
boliu
2017/03/03 22:01:31
nit: move friend line right below "private:"
Khushal
2017/03/03 23:36:07
I think you need the other way around. ViewAndroid
Jinsuk Kim
2017/03/06 04:07:34
Done.
Jinsuk Kim
2017/03/06 04:07:34
Done.
| |
| 73 | |
| 74 DISALLOW_COPY_AND_ASSIGN(EventHandler); | |
| 75 }; | |
| 76 | |
| 77 bool RegisterEventHandler(JNIEnv* env); | |
| 78 | |
| 79 } // namespace ui | |
| 80 | |
| 81 #endif // UI_ANDROID_EVENT_HANDLER_H_ | |
| OLD | NEW |