OLD | NEW |
(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/render_widget_host.h" |
| 9 #include "content/public/browser/render_widget_host_view.h" |
| 10 #include "content/public/browser/web_contents.h" |
| 11 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 12 |
| 13 namespace vr_shell { |
| 14 |
| 15 class RenderFrameHost; |
| 16 |
| 17 class VrInputManager { |
| 18 public: |
| 19 explicit VrInputManager(content::WebContents* web_contents); |
| 20 |
| 21 ~VrInputManager(); |
| 22 |
| 23 void SendScrollEvent(int64_t time_ms, |
| 24 float x, |
| 25 float y, |
| 26 float dx, |
| 27 float dy, |
| 28 int type); |
| 29 void SendClickEvent(int64_t time_ms, float x, float y); |
| 30 void SendMouseMoveEvent(int64_t time_ms, float x, float y, int type); |
| 31 |
| 32 void ScrollBegin(int64_t time_ms, |
| 33 float x, |
| 34 float y, |
| 35 float hintx, |
| 36 float hinty, |
| 37 bool target_viewport); |
| 38 void ScrollEnd(int64_t time_ms); |
| 39 void ScrollBy(int64_t time_ms, float x, float y, float dx, float dy); |
| 40 void PinchBegin(int64_t time_ms, float x, float y); |
| 41 void PinchEnd(int64_t time_ms); |
| 42 void PinchBy(int64_t time_ms, float x, float y, float delta); |
| 43 void SendPinchEvent(int64_t time_ms, float x, float y, float dz, int type); |
| 44 |
| 45 private: |
| 46 void SendGestureEvent(const blink::WebGestureEvent& event); |
| 47 void SendMouseEvent(const blink::WebMouseEvent& event); |
| 48 blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type, |
| 49 int64_t time_ms, |
| 50 float x, |
| 51 float y) const; |
| 52 |
| 53 // Device scale factor. |
| 54 float dpi_scale_; |
| 55 |
| 56 content::WebContents* web_contents_; |
| 57 DISALLOW_COPY_AND_ASSIGN(VrInputManager); |
| 58 }; |
| 59 |
| 60 } // namespace vr_shell |
| 61 |
| 62 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_INPUT_MANAGER_H_ |
OLD | NEW |