Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: ui/android/view_root.h

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: rebased & ViewAndroud::Bounds Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 #include <string>
10 #include <vector>
11
12 #include "base/android/jni_weak_ref.h"
13 #include "base/android/scoped_java_ref.h"
14 #include "base/macros.h"
15 #include "base/time/time.h"
16 #include "ui/android/ui_android_export.h"
17 #include "ui/android/view_android.h"
18 #include "ui/gfx/geometry/vector2d_f.h"
19
20 namespace ui {
21
22 // ViewRoot is the root of a ViewAndroid tree.
23 class UI_ANDROID_EXPORT ViewRoot : public ViewAndroid {
24 public:
25 explicit ViewRoot(jlong window_android_ptr);
26
27 void Destroy(JNIEnv* env,
28 const base::android::JavaParamRef<jobject>& obj);
29
30 // ViewAndroid overrides.
31 WindowAndroid* GetWindowAndroid() const override;
32 ViewAndroid* GetViewRoot() override;
33
34 // Move the give child ViewAndroid to the front of the list
35 // so that it can be the first responder of events.
36 void MoveToFront(ViewAndroid* child);
37
38 jboolean OnTouchEvent(
39 JNIEnv* env,
40 const base::android::JavaParamRef<jobject>& obj,
41 const base::android::JavaParamRef<jobject>& motion_event,
42 jlong time_ms,
43 jint android_action,
44 jint pointer_count,
45 jint history_size,
46 jint action_index,
47 jfloat pos_x_0,
48 jfloat pos_y_0,
49 jfloat pos_x_1,
50 jfloat pos_y_1,
51 jint pointer_id_0,
52 jint pointer_id_1,
53 jfloat touch_major_0,
54 jfloat touch_major_1,
55 jfloat touch_minor_0,
56 jfloat touch_minor_1,
57 jfloat orientation_0,
58 jfloat orientation_1,
59 jfloat tilt_0,
60 jfloat tilt_1,
61 jfloat raw_pos_x,
62 jfloat raw_pos_y,
63 jint android_tool_type_0,
64 jint android_tool_type_1,
65 jint android_button_state,
66 jint android_meta_state,
67 jboolean is_touch_handle_event);
68
69 private:
70 WindowAndroid* window_;
71
72 DISALLOW_COPY_AND_ASSIGN(ViewRoot);
73 };
74
75 bool RegisterViewRoot(JNIEnv* env);
76
77 } // namespace ui
78
79 #endif // UI_ANDROID_VIEW_ROOT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698