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

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

Issue 2872143002: VrShell: Exit fullscreen on app button press. (Closed)
Patch Set: update app button test 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.h ('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.h" 5 #include "chrome/browser/android/vr_shell/vr_shell.h"
6 6
7 #include <android/native_window_jni.h> 7 #include <android/native_window_jni.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 481
482 void VrShell::ForceExitVr() { 482 void VrShell::ForceExitVr() {
483 JNIEnv* env = base::android::AttachCurrentThread(); 483 JNIEnv* env = base::android::AttachCurrentThread();
484 Java_VrShellImpl_forceExitVr(env, j_vr_shell_.obj()); 484 Java_VrShellImpl_forceExitVr(env, j_vr_shell_.obj());
485 } 485 }
486 486
487 void VrShell::ExitPresent() { 487 void VrShell::ExitPresent() {
488 delegate_provider_->ExitWebVRPresent(); 488 delegate_provider_->ExitWebVRPresent();
489 } 489 }
490 490
491 void VrShell::ExitFullscreen() {
492 if (web_contents_ && web_contents_->IsFullscreen()) {
493 web_contents_->ExitFullscreen(false);
494 }
495 }
496
491 void VrShell::OnVRVsyncProviderRequest( 497 void VrShell::OnVRVsyncProviderRequest(
492 device::mojom::VRVSyncProviderRequest request) { 498 device::mojom::VRVSyncProviderRequest request) {
493 PostToGlThreadWhenReady(base::Bind(&VrShellGl::OnRequest, 499 PostToGlThreadWhenReady(base::Bind(&VrShellGl::OnRequest,
494 gl_thread_->GetVrShellGl(), 500 gl_thread_->GetVrShellGl(),
495 base::Passed(&request))); 501 base::Passed(&request)));
496 } 502 }
497 503
498 void VrShell::UpdateVSyncInterval(int64_t timebase_nanos, 504 void VrShell::UpdateVSyncInterval(int64_t timebase_nanos,
499 double interval_seconds) { 505 double interval_seconds) {
500 PostToGlThreadWhenReady(base::Bind(&VrShellGl::UpdateVSyncInterval, 506 PostToGlThreadWhenReady(base::Bind(&VrShellGl::UpdateVSyncInterval,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 jlong gvr_api, 558 jlong gvr_api,
553 jboolean reprojected_rendering) { 559 jboolean reprojected_rendering) {
554 return reinterpret_cast<intptr_t>(new VrShell( 560 return reinterpret_cast<intptr_t>(new VrShell(
555 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), 561 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android),
556 for_web_vr, in_cct, 562 for_web_vr, in_cct,
557 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), 563 VrShellDelegate::GetNativeVrShellDelegate(env, delegate),
558 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); 564 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering));
559 } 565 }
560 566
561 } // namespace vr_shell 567 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698