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

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

Issue 2471433002: Implement WebVR presentation pausing for VR Shell Menu Mode (Closed)
Patch Set: Add comments to VRDisplay 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
Index: chrome/browser/android/vr_shell/vr_shell_delegate.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.cc b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
index d4ce924bb39e442872567825273be37bf2807438..c7289b2b9137d1d21beab58ac2e2a7aa2d693700 100644
--- a/chrome/browser/android/vr_shell/vr_shell_delegate.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
@@ -6,6 +6,7 @@
#include "base/android/jni_android.h"
#include "chrome/browser/android/vr_shell/vr_shell.h"
+#include "device/vr/android/gvr/gvr_device_provider.h"
#include "jni/VrShellDelegate_jni.h"
using base::android::JavaParamRef;
@@ -49,12 +50,16 @@ VrShellDelegate::~VrShellDelegate() {
GvrDelegateProvider::SetInstance(nullptr);
}
-VrShellDelegate* VrShellDelegate::getNativeDelegate(
+VrShellDelegate* VrShellDelegate::GetNativeDelegate(
JNIEnv* env, jobject jdelegate) {
long native_delegate = Java_VrShellDelegate_getNativePointer(env, jdelegate);
return reinterpret_cast<VrShellDelegate*>(native_delegate);
}
+scoped_refptr<device::GvrDeviceProvider> VrShellDelegate::GetDeviceProvider() {
+ return device_provider_;
+}
+
void VrShellDelegate::ExitWebVRIfNecessary(JNIEnv* env, jobject obj) {
if (!device_provider_)
return;
@@ -63,10 +68,10 @@ void VrShellDelegate::ExitWebVRIfNecessary(JNIEnv* env, jobject obj) {
}
bool VrShellDelegate::RequestWebVRPresent(
- device::GvrDeviceProvider* device_provider) {
+ scoped_refptr<device::GvrDeviceProvider> device_provider) {
// Only set one device provider at a time
- DCHECK(!device_provider_);
- device_provider_ = device_provider;
+ DCHECK(!device_provider_.get());
dcheng 2016/11/11 00:48:21 Nit: no .get()
mthiesse 2016/11/11 20:19:21 Done.
+ device_provider_ = std::move(device_provider);
// If/When VRShell is ready for use it will call OnVrShellReady.
JNIEnv* env = AttachCurrentThread();

Powered by Google App Engine
This is Rietveld 408576698