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 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 "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 static VrShellDelegate* getNativeDelegate(JNIEnv* env, jobject jdelegate); | 23 static VrShellDelegate* getNativeDelegate(JNIEnv* env, jobject jdelegate); |
24 | 24 |
25 // Called by the Java VrShellDelegate. Returns true if the GvrDeviceProvider | 25 // Called by the Java VrShellDelegate. Returns true if the GvrDeviceProvider |
26 // needs to handle shutdown first. | 26 // needs to handle shutdown first. |
27 bool ExitWebVRIfNecessary(JNIEnv* env, jobject obj); | 27 bool ExitWebVRIfNecessary(JNIEnv* env, jobject obj); |
28 | 28 |
29 // device::vrDelegateProvider implementation | 29 // device::vrDelegateProvider implementation |
30 bool RequestWebVRPresent(device::GvrDeviceProvider* device_provider) override; | 30 bool RequestWebVRPresent(device::GvrDeviceProvider* device_provider) override; |
31 void ExitWebVRPresent() override; | 31 void ExitWebVRPresent() override; |
| 32 device::GvrDelegate* GetNonPresentingDelegate() override; |
| 33 void DestroyNonPresentingDelegate() override; |
32 | 34 |
33 // Called from VRShell | 35 // Called from VRShell |
34 void OnVrShellReady(VrShell* vr_shell); | 36 void OnVrShellReady(VrShell* vr_shell); |
35 | 37 |
36 private: | 38 private: |
| 39 std::unique_ptr<device::GvrDelegate> non_presenting_delegate_; |
37 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_; | 40 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_; |
38 device::GvrDeviceProvider* device_provider_; | 41 device::GvrDeviceProvider* device_provider_; |
39 | 42 |
40 DISALLOW_COPY_AND_ASSIGN(VrShellDelegate); | 43 DISALLOW_COPY_AND_ASSIGN(VrShellDelegate); |
41 }; | 44 }; |
42 | 45 |
43 bool RegisterVrShellDelegate(JNIEnv* env); | 46 bool RegisterVrShellDelegate(JNIEnv* env); |
44 | 47 |
45 } // namespace vr_shell | 48 } // namespace vr_shell |
46 | 49 |
47 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_ | 50 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_ |
OLD | NEW |