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

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: Fix presubmit Created 3 years, 9 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 Invalid = -1,
30 Start = 0,
31 Move = 1,
32 Cancel = 2,
33 End = 3,
34 Scroll = 4,
35 HoverEnter = 5,
36 HoverExit = 6,
37 HoverMove = 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
« no previous file with comments | « chrome/browser/android/vr_shell/PRESUBMIT.py ('k') | chrome/browser/android/vr_shell/android_ui_gesture_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698