Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: device/vr/android/gvr/gvr_delegate.h

Issue 2727873002: Implement lazy initialization for VrShellDelegate (Closed)
Patch Set: Fix FindBugs errors - neat! Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "device/vr/android/gvr/gvr_device_provider.h" 8 #include "device/vr/android/gvr/gvr_device_provider.h"
9 #include "device/vr/vr_export.h" 9 #include "device/vr/vr_export.h"
10 #include "device/vr/vr_service.mojom.h" 10 #include "device/vr/vr_service.mojom.h"
(...skipping 19 matching lines...) Expand all
30 virtual void CreateVRDisplayInfo( 30 virtual void CreateVRDisplayInfo(
31 const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback, 31 const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback,
32 uint32_t device_id) = 0; 32 uint32_t device_id) = 0;
33 33
34 protected: 34 protected:
35 virtual ~GvrDelegate() {} 35 virtual ~GvrDelegate() {}
36 }; 36 };
37 37
38 class DEVICE_VR_EXPORT GvrDelegateProvider { 38 class DEVICE_VR_EXPORT GvrDelegateProvider {
39 public: 39 public:
40 static void SetInstance(GvrDelegateProvider* delegate_provider); 40 static void SetInstance(
41 const base::Callback<GvrDelegateProvider*()>& provider_callback);
41 static GvrDelegateProvider* GetInstance(); 42 static GvrDelegateProvider* GetInstance();
42 43
43 virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0; 44 virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0;
44 virtual void ClearDeviceProvider() = 0; 45 virtual void ClearDeviceProvider() = 0;
45 virtual void RequestWebVRPresent( 46 virtual void RequestWebVRPresent(
46 const base::Callback<void(bool)>& callback) = 0; 47 const base::Callback<void(bool)>& callback) = 0;
47 virtual void ExitWebVRPresent() = 0; 48 virtual void ExitWebVRPresent() = 0;
48 virtual GvrDelegate* GetDelegate() = 0; 49 virtual GvrDelegate* GetDelegate() = 0;
49 virtual void SetListeningForActivate(bool listening) = 0; 50 virtual void SetListeningForActivate(bool listening) = 0;
50 51
51 protected: 52 protected:
52 virtual ~GvrDelegateProvider() {} 53 virtual ~GvrDelegateProvider() {}
53 54
54 private: 55 private:
55 static GvrDelegateProvider* delegate_provider_; 56 static base::Callback<GvrDelegateProvider*()> delegate_provider_;
56 }; 57 };
57 58
58 } // namespace device 59 } // namespace device
59 60
60 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H 61 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698