OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #include "content/renderer/vr_dispatcher.h" |
| 6 |
| 7 #include "content/public/renderer/render_thread.h" |
| 8 #include "ipc/ipc_sync_message_filter.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 VRDispatcher::VRDispatcher() { |
| 13 } |
| 14 |
| 15 VRDispatcher::~VRDispatcher() { |
| 16 } |
| 17 |
| 18 void VRDispatcher::GetVRDevices( |
| 19 blink::WebVector<blink::WebVRDevice>* devices) { |
| 20 std::vector<blink::WebVRDevice> ipcDevices; |
| 21 |
| 22 RenderThread::Get()->Send(new VRHostMsg_GetVRDevices(&ipcDevices)); |
| 23 if (devices && ipcDevices.size() > 0) |
| 24 devices->assign(&ipcDevices.front(), ipcDevices.size()); |
| 25 } |
| 26 |
| 27 void VRDispatcher::GetSensorState( |
| 28 unsigned int index, blink::WebHMDSensorState& state) { |
| 29 RenderThread::Get()->Send(new VRHostMsg_GetSensorState( |
| 30 index, &state)); |
| 31 } |
| 32 |
| 33 void VRDispatcher::ResetSensor(unsigned int index) { |
| 34 RenderThread::Get()->Send(new VRHostMsg_ResetSensor(index)); |
| 35 } |
| 36 |
| 37 void VRDispatcher::GetRenderTargetRects(unsigned index, |
| 38 blink::WebVRFieldOfView leftFov, |
| 39 blink::WebVRFieldOfView rightFov, |
| 40 blink::WebVRVector4* leftRect, |
| 41 blink::WebVRVector4* rightRect) { |
| 42 RenderThread::Get()->Send(new VRHostMsg_GetRenderTargetRects( |
| 43 index, leftFov, rightFov, leftRect, rightRect)); |
| 44 } |
| 45 |
| 46 } // namespace content |
OLD | NEW |