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

Side by Side Diff: chrome/browser/android/vr_shell/android_ui_gesture_target.h

Issue 2694103006: Inject vr controller events into Android Native UI. (Closed)
Patch Set: autoformat 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 CHROME_BROWSER_ANDROID_VR_SHELL_ANDROID_UI_GESTURE_TARGET_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_ANDROID_UI_GESTURE_TARGET_H_
7
8 #include <memory>
9
10 #include "base/android/jni_android.h"
11 #include "base/macros.h"
12 #include "base/time/time.h"
13 #include "third_party/WebKit/public/platform/WebGestureEvent.h"
14 #include "third_party/WebKit/public/platform/WebInputEvent.h"
15 #include "third_party/WebKit/public/platform/WebMouseEvent.h"
16
17 namespace vr_shell {
18
19 class AndroidUiGestureTarget {
20 public:
21 AndroidUiGestureTarget(jobject event_synthesizer, float dpr_ratio);
22 ~AndroidUiGestureTarget();
23
24 void DispatchWebInputEvent(std::unique_ptr<blink::WebInputEvent> event);
25
26 private:
27 // Enum values below need to be kept in sync with MotionEventSynthesizer.java.
28 enum Action {
29 ActionInvalid = -1,
cjgrant 2017/02/16 15:29:34 What about losing the Action prefix on these? vr_
mthiesse 2017/02/16 15:53:49 Done.
30 ActionStart = 0,
31 ActionMove = 1,
32 ActionCancel = 2,
33 ActionEnd = 3,
34 ActionScroll = 4,
35 ActionHoverEnter = 5,
36 ActionHoverExit = 6,
37 ActionHoverMove = 7,
38 };
39
40 void SetPointer(JNIEnv* env, int x, int y);
41 void SetScrollDeltas(JNIEnv* env, int x, int y, int dx, int dy);
42 void Inject(JNIEnv* env, Action action, double time_in_seconds);
43
44 jobject event_synthesizer_;
45 int scroll_x_ = 0;
46 int scroll_y_ = 0;
47 float scroll_ratio_;
48
49 DISALLOW_COPY_AND_ASSIGN(AndroidUiGestureTarget);
50 };
51
52 } // namespace vr_shell
53
54 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_ANDROID_UI_GESTURE_TARGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698