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::GetHMDSensorState( |
| 28 unsigned int index, blink::WebHMDSensorState& state) { |
| 29 RenderThread::Get()->Send(new VRHostMsg_GetHMDSensorState(index, &state)); |
| 30 } |
| 31 |
| 32 void VRDispatcher::ResetSensor(unsigned int index) { |
| 33 RenderThread::Get()->Send(new VRHostMsg_ResetSensor(index)); |
| 34 } |
| 35 |
| 36 void VRDispatcher::GetRenderTargetRects(unsigned index, |
| 37 blink::WebVRFieldOfView leftFov, |
| 38 blink::WebVRFieldOfView rightFov, |
| 39 blink::WebVRVector4* leftRect, |
| 40 blink::WebVRVector4* rightRect) { |
| 41 RenderThread::Get()->Send(new VRHostMsg_GetRenderTargetRects( |
| 42 index, leftFov, rightFov, leftRect, rightRect)); |
| 43 } |
| 44 |
| 45 } // namespace content |
OLD | NEW |