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 |