| Index: device/vr/vr_device_client_impl.cc
|
| diff --git a/device/vr/vr_device_client_impl.cc b/device/vr/vr_device_client_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0213d87daa255e92600609f5add249dec21ecc56
|
| --- /dev/null
|
| +++ b/device/vr/vr_device_client_impl.cc
|
| @@ -0,0 +1,49 @@
|
| +// Copyright 2016 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 <utility>
|
| +
|
| +#include "base/bind.h"
|
| +#include "device/vr/vr_device.h"
|
| +#include "device/vr/vr_service_impl.h"
|
| +
|
| +namespace device {
|
| +
|
| +VRDeviceClientImpl::VRDeviceClientImpl(mojo::InterfaceRequest<VRDevice> request,
|
| + device::VRDevice* device,
|
| + VRServiceImpl* service)
|
| + : binding_(this, std::move(request)) {
|
| + device_.reset(device);
|
| + service_.reset(service);
|
| +}
|
| +
|
| +void VRDeviceClientImpl::GetPose(const GetPoseCallback& callback) {
|
| + callback.Run(device_->GetPose(service_.get()));
|
| +}
|
| +
|
| +void VRDeviceClientImpl::ResetPose() {
|
| + device_->ResetPose(service_.get());
|
| +}
|
| +
|
| +void VRDeviceClientImpl::RequestPresent(
|
| + bool secureOrigin,
|
| + const RequestPresentCallback& callback) {
|
| + callback.Run(device_->RequestPresent(service_.get(), secureOrigin));
|
| +}
|
| +
|
| +void VRDeviceClientImpl::ExitPresent() {
|
| + device_->ExitPresent(service_.get());
|
| +}
|
| +
|
| +void VRDeviceClientImpl::SubmitFrame(mojom::VRPosePtr pose) {
|
| + device_->SubmitFrame(service_.get(), std::move(pose));
|
| +}
|
| +
|
| +void VRDeviceClientImpl::UpdateLayerBounds(
|
| + mojom::VRLayerBoundsPtr leftBounds,
|
| + mojom::VRLayerBoundsPtr rightBounds) {
|
| + device_->UpdateLayerBounds(service_.get(), std::move(leftBounds),
|
| + std::move(rightBounds));
|
| +}
|
| +}
|
|
|