Index: chrome/browser/android/vr_shell/vr_input_manager.h |
diff --git a/chrome/browser/android/vr_shell/vr_input_manager.h b/chrome/browser/android/vr_shell/vr_input_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..046790b5bbbfecc2c3a60638ae566416b6b58d87 |
--- /dev/null |
+++ b/chrome/browser/android/vr_shell/vr_input_manager.h |
@@ -0,0 +1,65 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_INPUT_MANAGER_H_ |
+#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_INPUT_MANAGER_H_ |
+ |
+#include "content/public/browser/android/content_view_core.h" |
+#include "content/public/browser/render_widget_host.h" |
+#include "content/public/browser/render_widget_host_view.h" |
+#include "content/public/browser/web_contents.h" |
+#include "third_party/WebKit/public/web/WebInputEvent.h" |
+ |
+namespace vr_shell { |
+ |
+class RenderFrameHost; |
+ |
+class VrInputManager { |
+ public: |
+ explicit VrInputManager(content::ContentViewCore* content_view_core); |
+ |
+ ~VrInputManager(); |
+ |
+ void SendScrollEvent(long time_ms, |
+ float x, |
+ float y, |
+ float dx, |
+ float dy, |
+ int type); |
+ void SendClickEvent(long time_ms, float x, float y); |
+ void SendMouseMoveEvent(long time_ms, float x, float y, int type); |
+ |
+ void ScrollBegin(long time_ms, |
+ float x, |
+ float y, |
+ float hintx, |
+ float hinty, |
+ bool target_viewport); |
+ void ScrollEnd(long time_ms); |
+ void ScrollBy(long time_ms, float x, float y, float dx, float dy); |
+ void PinchBegin(long time_ms, float x, float y); |
+ void PinchEnd(long time_ms); |
+ void PinchBy(long time_ms, float x, float y, float delta); |
+ void SendPinchEvent(long time_ms, float x, float y, float dz, int type); |
+ |
+ private: |
+ void SendGestureEvent(const blink::WebGestureEvent& event); |
+ void SendMouseEvent(const blink::WebMouseEvent& event); |
+ blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type, |
+ int64_t time_ms, |
+ float x, |
+ float y) const; |
+ |
+ 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.
|
+ |
+ // Device scale factor. |
+ float dpi_scale_; |
+ |
+ content::ContentViewCore* content_view_core_; |
+ DISALLOW_COPY_AND_ASSIGN(VrInputManager); |
+}; |
+ |
+} // namespace vr_shell |
+ |
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_INPUT_MANAGER_H_ |