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

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell_delegate.cc

Issue 2500153003: Fix broken VR transitions due to ChromeTabbedActivity not being exported. (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 unified diff | Download patch
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h" 5 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "chrome/browser/android/vr_shell/vr_shell.h" 8 #include "chrome/browser/android/vr_shell/vr_shell.h"
9 #include "device/vr/android/gvr/gvr_device_provider.h" 9 #include "device/vr/android/gvr/gvr_device_provider.h"
10 #include "jni/VrShellDelegate_jni.h" 10 #include "jni/VrShellDelegate_jni.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 bool VrShellDelegate::RequestWebVRPresent( 70 bool VrShellDelegate::RequestWebVRPresent(
71 base::WeakPtr<device::GvrDeviceProvider> device_provider) { 71 base::WeakPtr<device::GvrDeviceProvider> device_provider) {
72 // Only set one device provider at a time 72 // Only set one device provider at a time
73 DCHECK(!device_provider_); 73 DCHECK(!device_provider_);
74 device_provider_ = device_provider; 74 device_provider_ = device_provider;
75 75
76 // If/When VRShell is ready for use it will call OnVrShellReady. 76 // If/When VRShell is ready for use it will call OnVrShellReady.
77 JNIEnv* env = AttachCurrentThread(); 77 JNIEnv* env = AttachCurrentThread();
78 return Java_VrShellDelegate_enterVRIfNecessary(env, 78 Java_VrShellDelegate_enterVRIfNecessary(env, j_vr_shell_delegate_.obj(),
79 j_vr_shell_delegate_.obj(), 79 true);
80 true); 80 return true;
81 } 81 }
82 82
83 void VrShellDelegate::ExitWebVRPresent() { 83 void VrShellDelegate::ExitWebVRPresent() {
84 device_provider_.reset(); 84 device_provider_.reset();
85 85
86 // VRShell is no longer needed by WebVR, allow it to shut down if it's not 86 // VRShell is no longer needed by WebVR, allow it to shut down if it's not
87 // being used elsewhere. 87 // being used elsewhere.
88 JNIEnv* env = AttachCurrentThread(); 88 JNIEnv* env = AttachCurrentThread();
89 Java_VrShellDelegate_exitWebVR(env, j_vr_shell_delegate_.obj()); 89 Java_VrShellDelegate_exitWebVR(env, j_vr_shell_delegate_.obj());
90 } 90 }
(...skipping 27 matching lines...) Expand all
118 118
119 bool RegisterVrShellDelegate(JNIEnv* env) { 119 bool RegisterVrShellDelegate(JNIEnv* env) {
120 return RegisterNativesImpl(env); 120 return RegisterNativesImpl(env);
121 } 121 }
122 122
123 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 123 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
124 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); 124 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj));
125 } 125 }
126 126
127 } // namespace vr_shell 127 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698