| OLD | NEW |
| 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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 void VrShell::ContentWasShown() { | 485 void VrShell::ContentWasShown() { |
| 486 if (web_contents_) | 486 if (web_contents_) |
| 487 input_manager_ = base::MakeUnique<VrInputManager>(web_contents_); | 487 input_manager_ = base::MakeUnique<VrInputManager>(web_contents_); |
| 488 } | 488 } |
| 489 | 489 |
| 490 void VrShell::ForceExitVr() { | 490 void VrShell::ForceExitVr() { |
| 491 JNIEnv* env = base::android::AttachCurrentThread(); | 491 JNIEnv* env = base::android::AttachCurrentThread(); |
| 492 Java_VrShellImpl_forceExitVr(env, j_vr_shell_.obj()); | 492 Java_VrShellImpl_forceExitVr(env, j_vr_shell_.obj()); |
| 493 } | 493 } |
| 494 | 494 |
| 495 void VrShell::ExitFullscreen() { |
| 496 if (web_contents_ && web_contents_->IsFullscreen()) { |
| 497 web_contents_->ExitFullscreen(false); |
| 498 } |
| 499 } |
| 500 |
| 495 void VrShell::OnVRVsyncProviderRequest( | 501 void VrShell::OnVRVsyncProviderRequest( |
| 496 device::mojom::VRVSyncProviderRequest request) { | 502 device::mojom::VRVSyncProviderRequest request) { |
| 497 PostToGlThreadWhenReady(base::Bind(&VrShellGl::OnRequest, | 503 PostToGlThreadWhenReady(base::Bind(&VrShellGl::OnRequest, |
| 498 gl_thread_->GetVrShellGl(), | 504 gl_thread_->GetVrShellGl(), |
| 499 base::Passed(&request))); | 505 base::Passed(&request))); |
| 500 } | 506 } |
| 501 | 507 |
| 502 void VrShell::UpdateVSyncInterval(int64_t timebase_nanos, | 508 void VrShell::UpdateVSyncInterval(int64_t timebase_nanos, |
| 503 double interval_seconds) { | 509 double interval_seconds) { |
| 504 PostToGlThreadWhenReady(base::Bind(&VrShellGl::UpdateVSyncInterval, | 510 PostToGlThreadWhenReady(base::Bind(&VrShellGl::UpdateVSyncInterval, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 jlong gvr_api, | 562 jlong gvr_api, |
| 557 jboolean reprojected_rendering) { | 563 jboolean reprojected_rendering) { |
| 558 return reinterpret_cast<intptr_t>(new VrShell( | 564 return reinterpret_cast<intptr_t>(new VrShell( |
| 559 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 565 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 560 for_web_vr, in_cct, | 566 for_web_vr, in_cct, |
| 561 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 567 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 562 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 568 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 563 } | 569 } |
| 564 | 570 |
| 565 } // namespace vr_shell | 571 } // namespace vr_shell |
| OLD | NEW |