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/browser/vr/cardboard/cardboard_vr_device_provider.h" |
| 6 |
| 7 #include "content/browser/vr/cardboard/cardboard_vr_device.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 CardboardVRDeviceProvider::CardboardVRDeviceProvider() |
| 12 : VRDeviceProvider() |
| 13 , cardboard_device_(NULL) { |
| 14 } |
| 15 |
| 16 CardboardVRDeviceProvider::~CardboardVRDeviceProvider() { |
| 17 ReleaseDevices(); |
| 18 } |
| 19 |
| 20 void CardboardVRDeviceProvider::GetDevices(std::vector<VRDevice*>& devices) { |
| 21 if (!cardboard_device_) { |
| 22 cardboard_device_ = new CardboardVRDevice(this); |
| 23 } |
| 24 |
| 25 devices.push_back(cardboard_device_); |
| 26 } |
| 27 |
| 28 void CardboardVRDeviceProvider::Initialize() { |
| 29 |
| 30 } |
| 31 |
| 32 void CardboardVRDeviceProvider::ReleaseDevices() { |
| 33 if (cardboard_device_) { |
| 34 delete cardboard_device_; |
| 35 cardboard_device_ = NULL; |
| 36 } |
| 37 } |
| 38 |
| 39 } // namespace content |
OLD | NEW |