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

Unified Diff: chrome/browser/android/vr_shell/vr_shell_delegate.h

Issue 2343023002: Switch WebVR to handle GvrApi management through VrShellDelegate (Closed)
Patch Set: Renamed onNativeLibraryReady to initializeNative Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.cc ('k') | chrome/browser/android/vr_shell/vr_shell_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell_delegate.h
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.h b/chrome/browser/android/vr_shell/vr_shell_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..2c09b382bee433b5b7eaa45bd6d71bab69084b30
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_shell_delegate.h
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_
+
+#include <jni.h>
+
+#include "base/android/jni_weak_ref.h"
+#include "device/vr/android/gvr/gvr_delegate.h"
+
+namespace vr_shell {
+
+class VrShell;
+
+class VrShellDelegate : public device::GvrDelegateProvider {
+ public:
+ VrShellDelegate(JNIEnv* env, jobject obj);
+ virtual ~VrShellDelegate();
+
+ static VrShellDelegate* getNativeDelegate(JNIEnv* env, jobject jdelegate);
+
+ // Called by the Java VrShellDelegate. Returns true if the GvrDeviceProvider
+ // needs to handle shutdown first.
+ bool ExitWebVRIfNecessary(JNIEnv* env, jobject obj);
+
+ // device::vrDelegateProvider implementation
+ bool RequestWebVRPresent(device::GvrDeviceProvider* device_provider) override;
+ void ExitWebVRPresent() override;
+
+ // Called from VRShell
+ void OnVrShellReady(VrShell* vr_shell);
+
+ private:
+ base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_;
+ device::GvrDeviceProvider* device_provider_;
+};
+
+bool RegisterVrShellDelegate(JNIEnv* env);
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_DELEGATE_H_
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.cc ('k') | chrome/browser/android/vr_shell/vr_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698