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_DELEGATE_H | 5 #ifndef DEVICE_VR_ANDROID_GVR_DELEGATE_H |
6 #define DEVICE_VR_ANDROID_GVR_DELEGATE_H | 6 #define DEVICE_VR_ANDROID_GVR_DELEGATE_H |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "device/vr/android/gvr/gvr_device_provider.h" | 9 #include "device/vr/android/gvr/gvr_device_provider.h" |
10 #include "device/vr/vr_export.h" | 10 #include "device/vr/vr_export.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 virtual void SetGvrPoseForWebVr(const gvr::Mat4f& pose, | 26 virtual void SetGvrPoseForWebVr(const gvr::Mat4f& pose, |
27 uint32_t pose_index) = 0; | 27 uint32_t pose_index) = 0; |
28 virtual gvr::GvrApi* gvr_api() = 0; | 28 virtual gvr::GvrApi* gvr_api() = 0; |
29 }; | 29 }; |
30 | 30 |
31 class DEVICE_VR_EXPORT GvrDelegateProvider { | 31 class DEVICE_VR_EXPORT GvrDelegateProvider { |
32 public: | 32 public: |
33 static void SetInstance(GvrDelegateProvider* delegate_provider); | 33 static void SetInstance(GvrDelegateProvider* delegate_provider); |
34 static GvrDelegateProvider* GetInstance(); | 34 static GvrDelegateProvider* GetInstance(); |
35 | 35 |
36 virtual bool RequestWebVRPresent( | 36 virtual void RequestWebVRPresent( |
37 base::WeakPtr<GvrDeviceProvider> device_provider) = 0; | 37 base::WeakPtr<GvrDeviceProvider> device_provider, |
| 38 const base::Callback<void(bool)>& callback) = 0; |
38 virtual void ExitWebVRPresent() = 0; | 39 virtual void ExitWebVRPresent() = 0; |
39 virtual base::WeakPtr<GvrDelegate> GetNonPresentingDelegate() = 0; | 40 virtual base::WeakPtr<GvrDelegate> GetNonPresentingDelegate() = 0; |
40 virtual void DestroyNonPresentingDelegate() = 0; | 41 virtual void DestroyNonPresentingDelegate() = 0; |
41 | 42 |
42 private: | 43 private: |
43 static GvrDelegateProvider* delegate_provider_; | 44 static GvrDelegateProvider* delegate_provider_; |
44 }; | 45 }; |
45 | 46 |
46 } // namespace device | 47 } // namespace device |
47 | 48 |
48 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H | 49 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H |
OLD | NEW |