| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 <utility> |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "device/vr/vr_device.h" |
| 9 #include "device/vr/vr_service_impl.h" |
| 10 |
| 11 namespace device { |
| 12 |
| 13 VRDeviceClientImpl::VRDeviceClientImpl(mojo::InterfaceRequest<VRDevice> request, |
| 14 device::VRDevice* device, |
| 15 VRServiceImpl* service) |
| 16 : binding_(this, std::move(request)) { |
| 17 device_.reset(device); |
| 18 service_.reset(service); |
| 19 } |
| 20 |
| 21 void VRDeviceClientImpl::GetPose(const GetPoseCallback& callback) { |
| 22 callback.Run(device_->GetPose(service_.get())); |
| 23 } |
| 24 |
| 25 void VRDeviceClientImpl::ResetPose() { |
| 26 device_->ResetPose(service_.get()); |
| 27 } |
| 28 |
| 29 void VRDeviceClientImpl::RequestPresent( |
| 30 bool secureOrigin, |
| 31 const RequestPresentCallback& callback) { |
| 32 callback.Run(device_->RequestPresent(service_.get(), secureOrigin)); |
| 33 } |
| 34 |
| 35 void VRDeviceClientImpl::ExitPresent() { |
| 36 device_->ExitPresent(service_.get()); |
| 37 } |
| 38 |
| 39 void VRDeviceClientImpl::SubmitFrame(mojom::VRPosePtr pose) { |
| 40 device_->SubmitFrame(service_.get(), std::move(pose)); |
| 41 } |
| 42 |
| 43 void VRDeviceClientImpl::UpdateLayerBounds( |
| 44 mojom::VRLayerBoundsPtr leftBounds, |
| 45 mojom::VRLayerBoundsPtr rightBounds) { |
| 46 device_->UpdateLayerBounds(service_.get(), std::move(leftBounds), |
| 47 std::move(rightBounds)); |
| 48 } |
| 49 } |
| OLD | NEW |