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 <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(); | |
|
Khushal
2017/03/02 21:46:15
Not used?
Jinsuk Kim
2017/03/03 06:29:21
Removed.
| |
| 20 base::android::ScopedJavaLocalRef<jobject> CreateJavaObject(); | |
|
Khushal
2017/03/02 21:46:15
Should this class cache the java object instead of
Jinsuk Kim
2017/03/03 06:29:21
Done.
| |
| 21 | |
| 22 static EventHandler* Create(ViewAndroid* view); | |
|
Khushal
2017/03/02 21:46:15
nit: Do we need this Create method? We don't do an
boliu
2017/03/02 22:02:16
should return unique_ptr for passing ownership
Khushal
2017/03/02 22:08:59
Agreed. That was just a general comment if for som
Jinsuk Kim
2017/03/03 06:29:21
Turned the ctor public. ViewAndroid is the owner a
Jinsuk Kim
2017/03/03 06:29:21
Removed the method.
Jinsuk Kim
2017/03/03 06:29:21
Acknowledged.
| |
| 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 void 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 | |
| 75 DISALLOW_COPY_AND_ASSIGN(EventHandler); | |
| 76 }; | |
| 77 | |
| 78 bool RegisterEventHandler(JNIEnv* env); | |
| 79 | |
| 80 } // namespace ui | |
| 81 | |
| 82 #endif // UI_ANDROID_EVENT_HANDLER_H_ | |
| OLD | NEW |