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

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

Issue 2645353004: ViewRoot class for event forwarding on Android (Closed)
Patch Set: comments Created 3 years, 10 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
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 // TODO(jinsukkim): Hook this up to UI event forwarding flow and
18 // substitute WindowAndroid. See https://crbug.com/671401
19 class UI_ANDROID_EXPORT ViewRoot : public ViewAndroid {
20 public:
21 explicit ViewRoot(jlong window_android_ptr);
22
23 void Destroy(JNIEnv* env,
24 const base::android::JavaParamRef<jobject>& obj);
25
26 // ViewAndroid overrides.
27 WindowAndroid* GetWindowAndroid() const override;
28 ViewAndroid* GetViewRoot() override;
29
30 // Move the give child ViewAndroid to the front of the list
31 // so that it can be the first responder of events.
32 void MoveToFront(ViewAndroid* child);
33
34 jboolean OnTouchEvent(
35 JNIEnv* env,
36 const base::android::JavaParamRef<jobject>& obj,
37 const base::android::JavaParamRef<jobject>& motion_event,
38 jlong time_ms,
39 jint android_action,
40 jint pointer_count,
41 jint history_size,
42 jint action_index,
43 jfloat pos_x_0,
44 jfloat pos_y_0,
45 jfloat pos_x_1,
46 jfloat pos_y_1,
47 jint pointer_id_0,
48 jint pointer_id_1,
49 jfloat touch_major_0,
50 jfloat touch_major_1,
51 jfloat touch_minor_0,
52 jfloat touch_minor_1,
53 jfloat orientation_0,
54 jfloat orientation_1,
55 jfloat tilt_0,
56 jfloat tilt_1,
57 jfloat raw_pos_x,
58 jfloat raw_pos_y,
59 jint android_tool_type_0,
60 jint android_tool_type_1,
61 jint android_button_state,
62 jint android_meta_state,
63 jboolean is_touch_handle_event);
64
65 private:
66 WindowAndroid* window_;
67
68 DISALLOW_COPY_AND_ASSIGN(ViewRoot);
69 };
70
71 bool RegisterViewRoot(JNIEnv* env);
72
73 } // namespace ui
74
75 #endif // UI_ANDROID_VIEW_ROOT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698