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

Side by Side Diff: chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h

Issue 2889693005: Stay in VR while showing DOFF flow and connect CCT exit button to this. (Closed)
Patch Set: rebase Created 3 years, 7 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 CHROME_BROWSER_ANDROID_VR_SHELL_NON_PRESENTING_GVR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_NON_PRESENTING_GVR_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_NON_PRESENTING_GVR_DELEGATE_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_NON_PRESENTING_GVR_DELEGATE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 29 matching lines...) Expand all
40 double interval_seconds) override; 40 double interval_seconds) override;
41 41
42 void CreateVRDisplayInfo( 42 void CreateVRDisplayInfo(
43 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, 43 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback,
44 uint32_t device_id) override; 44 uint32_t device_id) override;
45 45
46 void Pause(); 46 void Pause();
47 void Resume(); 47 void Resume();
48 device::mojom::VRVSyncProviderRequest OnSwitchToPresentingDelegate(); 48 device::mojom::VRVSyncProviderRequest OnSwitchToPresentingDelegate();
49 49
50 void UpdateContext(gvr_context* context);
51
50 private: 52 private:
51 void StopVSyncLoop(); 53 void StopVSyncLoop();
52 void StartVSyncLoop(); 54 void StartVSyncLoop();
53 void OnVSync(); 55 void OnVSync();
54 void SendVSync(base::TimeDelta time, const GetVSyncCallback& callback); 56 void SendVSync(base::TimeDelta time, const GetVSyncCallback& callback);
55 57
56 // VRVSyncProvider implementation 58 // VRVSyncProvider implementation
57 void GetVSync(const GetVSyncCallback& callback) override; 59 void GetVSync(const GetVSyncCallback& callback) override;
58 60
59 std::unique_ptr<gvr::GvrApi> gvr_api_; 61 std::unique_ptr<gvr::GvrApi> gvr_api_;
60 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 62 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
61 base::CancelableClosure vsync_task_; 63 base::CancelableClosure vsync_task_;
62 base::TimeTicks vsync_timebase_; 64 base::TimeTicks vsync_timebase_;
63 base::TimeDelta vsync_interval_; 65 base::TimeDelta vsync_interval_;
64 66
65 // Whether the vsync loop is paused, but not stopped. 67 // Whether the vsync loop is paused, but not stopped.
66 bool vsync_paused_ = false; 68 bool vsync_paused_ = false;
67 base::TimeDelta pending_time_; 69 base::TimeDelta pending_time_;
68 bool pending_vsync_ = false; 70 bool pending_vsync_ = false;
69 GetVSyncCallback callback_; 71 GetVSyncCallback callback_;
70 mojo::Binding<device::mojom::VRVSyncProvider> binding_; 72 mojo::Binding<device::mojom::VRVSyncProvider> binding_;
71 base::WeakPtrFactory<NonPresentingGvrDelegate> weak_ptr_factory_; 73 base::WeakPtrFactory<NonPresentingGvrDelegate> weak_ptr_factory_;
72 74
73 DISALLOW_COPY_AND_ASSIGN(NonPresentingGvrDelegate); 75 DISALLOW_COPY_AND_ASSIGN(NonPresentingGvrDelegate);
74 }; 76 };
75 77
76 } // namespace vr_shell 78 } // namespace vr_shell
77 79
78 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_NON_PRESENTING_GVR_DELEGATE_H_ 80 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_NON_PRESENTING_GVR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698