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

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

Issue 2510873003: Clean up WebVR RequestPresent and make callback asynchronous. (Closed)
Patch Set: Fix FakeVRDevice Created 4 years, 1 month 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
« no previous file with comments | « device/vr/android/gvr/gvr_device.cc ('k') | device/vr/android/gvr/gvr_device_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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"
(...skipping 12 matching lines...) Expand all
23 23
24 class DEVICE_VR_EXPORT GvrDeviceProvider : public VRDeviceProvider { 24 class DEVICE_VR_EXPORT GvrDeviceProvider : public VRDeviceProvider {
25 public: 25 public:
26 GvrDeviceProvider(); 26 GvrDeviceProvider();
27 ~GvrDeviceProvider() override; 27 ~GvrDeviceProvider() override;
28 28
29 void GetDevices(std::vector<VRDevice*>* devices) override; 29 void GetDevices(std::vector<VRDevice*>* devices) override;
30 void Initialize() override; 30 void Initialize() override;
31 31
32 // Called from GvrDevice. 32 // Called from GvrDevice.
33 bool RequestPresent(); 33 void RequestPresent(const base::Callback<void(bool)>& callback);
34 void ExitPresent(); 34 void ExitPresent();
35 35
36 void OnGvrDelegateReady(const base::WeakPtr<GvrDelegate>& delegate); 36 void OnGvrDelegateReady(const base::WeakPtr<GvrDelegate>& delegate);
37 void OnGvrDelegateRemoved(); 37 void OnGvrDelegateRemoved();
38 void OnDisplayBlur(); 38 void OnDisplayBlur();
39 void OnDisplayFocus(); 39 void OnDisplayFocus();
40 40
41 private: 41 private:
42 void SwitchToNonPresentingDelegate(); 42 void SwitchToNonPresentingDelegate();
43 43
44 std::unique_ptr<GvrDevice> vr_device_; 44 std::unique_ptr<GvrDevice> vr_device_;
45 45
46 base::WeakPtrFactory<GvrDeviceProvider> weak_ptr_factory_; 46 base::WeakPtrFactory<GvrDeviceProvider> weak_ptr_factory_;
47 47
48 DISALLOW_COPY_AND_ASSIGN(GvrDeviceProvider); 48 DISALLOW_COPY_AND_ASSIGN(GvrDeviceProvider);
49 }; 49 };
50 50
51 } // namespace device 51 } // namespace device
52 52
53 #endif // DEVICE_VR_ANDROID_GVR_DEVICE_PROVIDER_H 53 #endif // DEVICE_VR_ANDROID_GVR_DEVICE_PROVIDER_H
OLDNEW
« no previous file with comments | « device/vr/android/gvr/gvr_device.cc ('k') | device/vr/android/gvr/gvr_device_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698