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

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

Issue 2350253004: Controller support for VrShell (Closed)
Patch Set: rebased + moved vr_input_manager Created 4 years, 2 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 2016 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_VR_INPUT_MANAGER_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_INPUT_MANAGER_H_
7
8 #include "content/public/browser/android/content_view_core.h"
9 #include "content/public/browser/render_widget_host.h"
10 #include "content/public/browser/render_widget_host_view.h"
11 #include "content/public/browser/web_contents.h"
12 #include "third_party/WebKit/public/web/WebInputEvent.h"
13
14 namespace vr_shell {
15
16 class RenderFrameHost;
17
18 class VrInputManager {
19 public:
20 explicit VrInputManager(content::ContentViewCore* content_view_core);
21
22 ~VrInputManager();
23
24 void SendScrollEvent(long time_ms,
25 float x,
26 float y,
27 float dx,
28 float dy,
29 int type);
30 void SendClickEvent(long time_ms, float x, float y);
31 void SendMouseMoveEvent(long time_ms, float x, float y, int type);
32
33 void ScrollBegin(long time_ms,
34 float x,
35 float y,
36 float hintx,
37 float hinty,
38 bool target_viewport);
39 void ScrollEnd(long time_ms);
40 void ScrollBy(long time_ms, float x, float y, float dx, float dy);
41 void PinchBegin(long time_ms, float x, float y);
42 void PinchEnd(long time_ms);
43 void PinchBy(long time_ms, float x, float y, float delta);
44 void SendPinchEvent(long time_ms, float x, float y, float dz, int type);
45
46 private:
47 void SendGestureEvent(const blink::WebGestureEvent& event);
48 void SendMouseEvent(const blink::WebMouseEvent& event);
49 blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type,
50 int64_t time_ms,
51 float x,
52 float y) const;
53
54 float dpi_scale() const { return dpi_scale_; }
bshe 2016/09/22 23:16:49 nit: no need for private accessor. you can directl
asimjour 2016/09/23 16:58:22 Done.
55
56 // Device scale factor.
57 float dpi_scale_;
58
59 content::ContentViewCore* content_view_core_;
60 DISALLOW_COPY_AND_ASSIGN(VrInputManager);
61 };
62
63 } // namespace vr_shell
64
65 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_INPUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698