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_VIEW_ROOT_H_ | |
6 #define UI_ANDROID_VIEW_ROOT_H_ | |
7 | |
8 #include <jni.h> | |
9 | |
10 #include "base/android/scoped_java_ref.h" | |
11 #include "ui/android/ui_android_export.h" | |
12 #include "ui/android/view_android.h" | |
13 | |
14 namespace ui { | |
15 | |
16 // ViewRoot is the root of a ViewAndroid tree. | |
17 class UI_ANDROID_EXPORT ViewRoot : public ViewAndroid { | |
18 public: | |
19 explicit ViewRoot(jlong window_android_ptr); | |
20 | |
21 void Destroy(JNIEnv* env, | |
22 const base::android::JavaParamRef<jobject>& obj); | |
23 | |
24 // ViewAndroid overrides. | |
25 WindowAndroid* GetWindowAndroid() const override; | |
26 ViewAndroid* GetViewRoot() override; | |
27 | |
28 // Move the give child ViewAndroid to the front of the list | |
29 // so that it can be the first responder of events. | |
30 void MoveToFront(ViewAndroid* child); | |
boliu
2017/01/24 23:47:13
why only on the root?
Jinsuk Kim
2017/01/25 02:34:34
Practically this is necessary only at the top leve
Jinsuk Kim
2017/01/25 08:13:31
On second thought, this should be in ViewAndroid.
| |
31 | |
32 jboolean OnTouchEvent( | |
33 JNIEnv* env, | |
34 const base::android::JavaParamRef<jobject>& obj, | |
35 const base::android::JavaParamRef<jobject>& motion_event, | |
36 jlong time_ms, | |
37 jint android_action, | |
38 jint pointer_count, | |
39 jint history_size, | |
40 jint action_index, | |
41 jfloat pos_x_0, | |
42 jfloat pos_y_0, | |
43 jfloat pos_x_1, | |
44 jfloat pos_y_1, | |
45 jint pointer_id_0, | |
46 jint pointer_id_1, | |
47 jfloat touch_major_0, | |
48 jfloat touch_major_1, | |
49 jfloat touch_minor_0, | |
50 jfloat touch_minor_1, | |
51 jfloat orientation_0, | |
52 jfloat orientation_1, | |
53 jfloat tilt_0, | |
54 jfloat tilt_1, | |
55 jfloat raw_pos_x, | |
56 jfloat raw_pos_y, | |
57 jint android_tool_type_0, | |
58 jint android_tool_type_1, | |
59 jint android_button_state, | |
60 jint android_meta_state, | |
61 jboolean is_touch_handle_event); | |
62 | |
63 private: | |
64 WindowAndroid* window_; | |
65 | |
66 DISALLOW_COPY_AND_ASSIGN(ViewRoot); | |
67 }; | |
68 | |
69 bool RegisterViewRoot(JNIEnv* env); | |
70 | |
71 } // namespace ui | |
72 | |
73 #endif // UI_ANDROID_VIEW_ROOT_H_ | |
OLD | NEW |