| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_VR_ANDROID_GVR_DEVICE_PROVIDER_H | 5 #ifndef DEVICE_VR_ANDROID_GVR_DEVICE_PROVIDER_H |
| 6 #define DEVICE_VR_ANDROID_GVR_DEVICE_PROVIDER_H | 6 #define DEVICE_VR_ANDROID_GVR_DEVICE_PROVIDER_H |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "device/vr/vr_device.h" | 12 #include "device/vr/vr_device.h" |
| 13 #include "device/vr/vr_device_provider.h" | 13 #include "device/vr/vr_device_provider.h" |
| 14 #include "device/vr/vr_export.h" | 14 #include "device/vr/vr_export.h" |
| 15 | 15 |
| 16 namespace device { | 16 namespace device { |
| 17 | 17 |
| 18 class GvrDelegate; | 18 class GvrDelegate; |
| 19 class GvrDevice; | 19 class GvrDevice; |
| 20 class VRServiceImpl; | 20 class VRServiceImpl; |
| 21 | 21 |
| 22 class DEVICE_VR_EXPORT GvrDeviceProvider : public VRDeviceProvider { | 22 class DEVICE_VR_EXPORT GvrDeviceProvider : public VRDeviceProvider { |
| 23 public: | 23 public: |
| 24 GvrDeviceProvider(); | 24 GvrDeviceProvider(); |
| 25 ~GvrDeviceProvider() override; | |
| 26 | 25 |
| 27 void GetDevices(std::vector<VRDevice*>* devices) override; | 26 void GetDevices(std::vector<VRDevice*>* devices) override; |
| 28 void Initialize() override; | 27 void Initialize() override; |
| 29 | 28 |
| 30 // Called from GvrDevice | 29 // Called from GvrDevice. |
| 31 bool RequestPresent(); | 30 bool RequestPresent(); |
| 32 void ExitPresent(); | 31 void ExitPresent(); |
| 33 | 32 |
| 34 // Called from GvrDelegate | 33 // Called from GvrDelegate. May be called from any thread. |
| 35 void OnGvrDelegateReady(GvrDelegate* delegate); | 34 void OnGvrDelegateReady(GvrDelegate* delegate); |
| 36 void OnGvrDelegateRemoved(); | 35 void OnGvrDelegateRemoved(); |
| 37 | 36 |
| 37 // May be called from any thread. This function is likely to be called from |
| 38 // an arbitrary GL thread handling GVR controller updates. |
| 39 void OnDisplayBlur(); |
| 40 |
| 41 // May be called from any thread. This function is likely to be called from |
| 42 // an arbitrary GL thread handling GVR controller updates. |
| 43 void OnDisplayFocus(); |
| 44 |
| 38 private: | 45 private: |
| 46 ~GvrDeviceProvider() override; |
| 47 |
| 39 void GvrDelegateReady(GvrDelegate* delegate); | 48 void GvrDelegateReady(GvrDelegate* delegate); |
| 40 void GvrDelegateRemoved(); | 49 void GvrDelegateRemoved(); |
| 41 | 50 |
| 42 std::unique_ptr<GvrDevice> vr_device_; | 51 std::unique_ptr<GvrDevice> vr_device_; |
| 43 | 52 |
| 44 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 53 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 45 | 54 |
| 46 DISALLOW_COPY_AND_ASSIGN(GvrDeviceProvider); | 55 DISALLOW_COPY_AND_ASSIGN(GvrDeviceProvider); |
| 47 }; | 56 }; |
| 48 | 57 |
| 49 } // namespace device | 58 } // namespace device |
| 50 | 59 |
| 51 #endif // DEVICE_VR_ANDROID_GVR_DEVICE_PROVIDER_H | 60 #endif // DEVICE_VR_ANDROID_GVR_DEVICE_PROVIDER_H |
| OLD | NEW |