OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "base/android/jni_weak_ref.h" |
| 11 #include "device/vr/android/gvr/gvr_delegate.h" |
| 12 |
| 13 namespace vr_shell { |
| 14 |
| 15 class VrShell; |
| 16 |
| 17 class VrShellDelegate : public device::GvrDelegateProvider { |
| 18 public: |
| 19 VrShellDelegate(JNIEnv* env, jobject obj); |
| 20 virtual ~VrShellDelegate(); |
| 21 |
| 22 static VrShellDelegate* getNativeDelegate(JNIEnv* env, jobject jdelegate); |
| 23 |
| 24 // Called by the Java VrShellDelegate. Returns true if the GvrDeviceProvider |
| 25 // needs to handle shutdown first. |
| 26 bool ExitWebVRIfNecessary(JNIEnv* env, jobject obj); |
| 27 |
| 28 // device::vrDelegateProvider implementation |
| 29 bool RequestWebVRPresent(device::GvrDeviceProvider* device_provider) override; |
| 30 void ExitWebVRPresent() override; |
| 31 |
| 32 // Called from VRShell |
| 33 void OnVrShellReady(VrShell* vr_shell); |
| 34 |
| 35 private: |
| 36 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_; |
| 37 device::GvrDeviceProvider* device_provider_; |
| 38 }; |
| 39 |
| 40 bool RegisterVrShellDelegate(JNIEnv* env); |
| 41 |
| 42 } // namespace vr_shell |
| 43 |
| 44 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_ |
OLD | NEW |