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* getNativePointer(JNIEnv* env, jobject jdelegate); |
| 23 |
| 24 // Called by the Java VrShellDelegate |
| 25 bool ExitWebVRIfNecessary(JNIEnv* env, jobject obj); |
| 26 |
| 27 // device::vrDelegateProvider implementation |
| 28 bool RequestWebVRPresent(device::GvrDeviceProvider* device_provider) override; |
| 29 void ExitWebVRPresent() override; |
| 30 |
| 31 // Called from VRShell |
| 32 void OnVrShellReady(VrShell* vr_shell); |
| 33 |
| 34 private: |
| 35 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_; |
| 36 device::GvrDeviceProvider* device_provider_; |
| 37 }; |
| 38 |
| 39 bool RegisterVrShellDelegate(JNIEnv* env); |
| 40 |
| 41 } // namespace vr_shell |
| 42 |
| 43 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_ |
OLD | NEW |