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

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

Issue 2471433002: Implement WebVR presentation pausing for VR Shell Menu Mode (Closed)
Patch Set: rebase Created 4 years, 1 month 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
index 4ac1dfc859823f20b92b8a290677039ea304caf2..ff8b228b928fb8f4447771b82ad3fad3b5b452b6 100644
--- a/chrome/browser/android/vr_shell/vr_shell_delegate.h
+++ b/chrome/browser/android/vr_shell/vr_shell_delegate.h
@@ -11,6 +11,10 @@
#include "base/macros.h"
#include "device/vr/android/gvr/gvr_delegate.h"
+namespace device {
+class GvrDeviceProvider;
+}
+
namespace vr_shell {
class VrShell;
@@ -20,25 +24,25 @@ class VrShellDelegate : public device::GvrDelegateProvider {
VrShellDelegate(JNIEnv* env, jobject obj);
virtual ~VrShellDelegate();
- static VrShellDelegate* getNativeDelegate(JNIEnv* env, jobject jdelegate);
+ static VrShellDelegate* GetNativeDelegate(JNIEnv* env, jobject jdelegate);
+
+ base::WeakPtr<device::GvrDeviceProvider> GetDeviceProvider();
// Called by the Java VrShellDelegate. Returns true if the GvrDeviceProvider
// needs to handle shutdown first.
void ExitWebVRIfNecessary(JNIEnv* env, jobject obj);
- // device::vrDelegateProvider implementation
- bool RequestWebVRPresent(device::GvrDeviceProvider* device_provider) override;
+ // device::GvrDelegateProvider implementation
+ bool RequestWebVRPresent(
+ base::WeakPtr<device::GvrDeviceProvider> device_provider) override;
void ExitWebVRPresent() override;
- device::GvrDelegate* GetNonPresentingDelegate() override;
+ base::WeakPtr<device::GvrDelegate> GetNonPresentingDelegate() override;
void DestroyNonPresentingDelegate() override;
- // Called from VRShell
- void OnVrShellReady(VrShell* vr_shell);
-
private:
std::unique_ptr<device::GvrDelegate> non_presenting_delegate_;
base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_;
- device::GvrDeviceProvider* device_provider_;
+ base::WeakPtr<device::GvrDeviceProvider> device_provider_;
DISALLOW_COPY_AND_ASSIGN(VrShellDelegate);
};
« 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