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

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

Issue 2864363005: Prevents exiting presentation if triggering DON while presenting. (Closed)
Patch Set: Changed parameter to underscore case Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_delegate.h ('k') | device/vr/vr_service.mojom » ('j') | 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 <utility> 7 #include <utility>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 JNIEnv* env = AttachCurrentThread(); 199 JNIEnv* env = AttachCurrentThread();
200 gvr_context* context = reinterpret_cast<gvr_context*>( 200 gvr_context* context = reinterpret_cast<gvr_context*>(
201 Java_VrShellDelegate_createNonPresentingNativeContext( 201 Java_VrShellDelegate_createNonPresentingNativeContext(
202 env, j_vr_shell_delegate_.obj())); 202 env, j_vr_shell_delegate_.obj()));
203 non_presenting_delegate_ = 203 non_presenting_delegate_ =
204 base::MakeUnique<NonPresentingGvrDelegate>(context); 204 base::MakeUnique<NonPresentingGvrDelegate>(context);
205 non_presenting_delegate_->UpdateVSyncInterval(timebase_nanos_, 205 non_presenting_delegate_->UpdateVSyncInterval(timebase_nanos_,
206 interval_seconds_); 206 interval_seconds_);
207 } 207 }
208 208
209 void VrShellDelegate::OnActivateDisplayHandled(bool present_requested) { 209 void VrShellDelegate::OnActivateDisplayHandled(bool will_not_present) {
210 if (!present_requested) { 210 if (will_not_present) {
211 // WebVR page didn't request presentation in the vrdisplayactivate handler. 211 // WebVR page didn't request presentation in the vrdisplayactivate handler.
212 // Tell VrShell that we are in VR Browsing Mode. 212 // Tell VrShell that we are in VR Browsing Mode.
213 ExitWebVRPresent(); 213 ExitWebVRPresent();
214 } 214 }
215 } 215 }
216 216
217 device::GvrDelegate* VrShellDelegate::GetDelegate() { 217 device::GvrDelegate* VrShellDelegate::GetDelegate() {
218 if (presenting_delegate_) 218 if (presenting_delegate_)
219 return presenting_delegate_; 219 return presenting_delegate_;
220 return non_presenting_delegate_.get(); 220 return non_presenting_delegate_.get();
(...skipping 16 matching lines...) Expand all
237 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 237 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
238 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); 238 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj));
239 } 239 }
240 240
241 static void OnLibraryAvailable(JNIEnv* env, const JavaParamRef<jclass>& clazz) { 241 static void OnLibraryAvailable(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
242 device::GvrDelegateProvider::SetInstance( 242 device::GvrDelegateProvider::SetInstance(
243 base::Bind(&VrShellDelegate::CreateVrShellDelegate)); 243 base::Bind(&VrShellDelegate::CreateVrShellDelegate));
244 } 244 }
245 245
246 } // namespace vr_shell 246 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_delegate.h ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698