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

Unified Diff: content/renderer/vr_dispatcher.cc

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the rest of sievers@ input Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/vr_dispatcher.cc
diff --git a/content/renderer/vr_dispatcher.cc b/content/renderer/vr_dispatcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..465eaceb684f573f3af7b84d9f0af1c6f4097fea
--- /dev/null
+++ b/content/renderer/vr_dispatcher.cc
@@ -0,0 +1,46 @@
+// Copyright 2015 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.
+
+#include "content/renderer/vr_dispatcher.h"
+
+#include "content/public/renderer/render_thread.h"
+#include "ipc/ipc_sync_message_filter.h"
+
+namespace content {
+
+VRDispatcher::VRDispatcher() {
+}
+
+VRDispatcher::~VRDispatcher() {
+}
+
+void VRDispatcher::GetVRDevices(
+ blink::WebVector<blink::WebVRDevice>* devices) {
+ std::vector<blink::WebVRDevice> ipcDevices;
+
+ RenderThread::Get()->Send(new VRHostMsg_GetVRDevices(&ipcDevices));
+ if (devices && ipcDevices.size() > 0)
+ devices->assign(&ipcDevices.front(), ipcDevices.size());
+}
+
+void VRDispatcher::GetSensorState(
+ unsigned int index, blink::WebHMDSensorState& state) {
+ RenderThread::Get()->Send(new VRHostMsg_GetSensorState(
+ index, &state));
+}
+
+void VRDispatcher::ResetSensor(unsigned int index) {
+ RenderThread::Get()->Send(new VRHostMsg_ResetSensor(index));
+}
+
+void VRDispatcher::GetRenderTargetRects(unsigned index,
+ blink::WebVRFieldOfView leftFov,
+ blink::WebVRFieldOfView rightFov,
+ blink::WebVRVector4* leftRect,
+ blink::WebVRVector4* rightRect) {
+ RenderThread::Get()->Send(new VRHostMsg_GetRenderTargetRects(
+ index, leftFov, rightFov, leftRect, rightRect));
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698