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

Unified Diff: chrome/browser/android/vr_shell/vr_input_manager.h

Issue 2350253004: Controller support for VrShell (Closed)
Patch Set: Clean up Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_gesture.h ('k') | chrome/browser/android/vr_shell/vr_input_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d8fa1370c4dacf7d4090656ee0c06005dbccca04
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_input_manager.h
@@ -0,0 +1,62 @@
+// 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/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::WebContents* web_contents);
+
+ ~VrInputManager();
+
+ void SendScrollEvent(int64_t time_ms,
+ float x,
+ float y,
+ float dx,
+ float dy,
+ int type);
+ void SendClickEvent(int64_t time_ms, float x, float y);
+ void SendMouseMoveEvent(int64_t time_ms, float x, float y, int type);
+
+ void ScrollBegin(int64_t time_ms,
+ float x,
+ float y,
+ float hintx,
+ float hinty,
+ bool target_viewport);
+ void ScrollEnd(int64_t time_ms);
+ void ScrollBy(int64_t time_ms, float x, float y, float dx, float dy);
+ void PinchBegin(int64_t time_ms, float x, float y);
+ void PinchEnd(int64_t time_ms);
+ void PinchBy(int64_t time_ms, float x, float y, float delta);
+ void SendPinchEvent(int64_t 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;
+
+ // Device scale factor.
+ float dpi_scale_;
+
+ content::WebContents* web_contents_;
+ DISALLOW_COPY_AND_ASSIGN(VrInputManager);
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_INPUT_MANAGER_H_
« no previous file with comments | « chrome/browser/android/vr_shell/vr_gesture.h ('k') | chrome/browser/android/vr_shell/vr_input_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698