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

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

Issue 2844833005: Tentatively goes into WebVR presentation mode if page listens to vrdisplayactivate. (Closed)
Patch Set: Fixed device unit tests 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_VR_SHELL_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // device::GvrDelegateProvider implementation. 61 // device::GvrDelegateProvider implementation.
62 void SetDeviceProvider(device::GvrDeviceProvider* device_provider) override; 62 void SetDeviceProvider(device::GvrDeviceProvider* device_provider) override;
63 void ClearDeviceProvider() override; 63 void ClearDeviceProvider() override;
64 void RequestWebVRPresent(device::mojom::VRSubmitFrameClientPtr submit_client, 64 void RequestWebVRPresent(device::mojom::VRSubmitFrameClientPtr submit_client,
65 const base::Callback<void(bool)>& callback) override; 65 const base::Callback<void(bool)>& callback) override;
66 device::GvrDelegate* GetDelegate() override; 66 device::GvrDelegate* GetDelegate() override;
67 void SetListeningForActivate(bool listening) override; 67 void SetListeningForActivate(bool listening) override;
68 68
69 void CreateNonPresentingDelegate(); 69 void CreateNonPresentingDelegate();
70 70
71 void OnActivateDisplayHandled(bool present_requested);
72
71 std::unique_ptr<NonPresentingGvrDelegate> non_presenting_delegate_; 73 std::unique_ptr<NonPresentingGvrDelegate> non_presenting_delegate_;
72 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_; 74 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_;
73 device::GvrDeviceProvider* device_provider_ = nullptr; 75 device::GvrDeviceProvider* device_provider_ = nullptr;
74 device::PresentingGvrDelegate* presenting_delegate_ = nullptr; 76 device::PresentingGvrDelegate* presenting_delegate_ = nullptr;
75 base::Callback<void(bool)> present_callback_; 77 base::Callback<void(bool)> present_callback_;
76 int64_t timebase_nanos_ = 0; 78 int64_t timebase_nanos_ = 0;
77 double interval_seconds_ = 0; 79 double interval_seconds_ = 0;
78 device::mojom::VRSubmitFrameClientPtr submit_client_; 80 device::mojom::VRSubmitFrameClientPtr submit_client_;
79 bool pending_successful_present_request_ = false; 81 bool pending_successful_present_request_ = false;
80 82
83 base::WeakPtrFactory<VrShellDelegate> weak_ptr_factory_;
84
81 DISALLOW_COPY_AND_ASSIGN(VrShellDelegate); 85 DISALLOW_COPY_AND_ASSIGN(VrShellDelegate);
82 }; 86 };
83 87
84 bool RegisterVrShellDelegate(JNIEnv* env); 88 bool RegisterVrShellDelegate(JNIEnv* env);
85 89
86 } // namespace vr_shell 90 } // namespace vr_shell
87 91
88 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_ 92 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698