| 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 void VrShell::ExitPresent() { | 575 void VrShell::ExitPresent() { |
| 576 delegate_provider_->ExitWebVRPresent(); | 576 delegate_provider_->ExitWebVRPresent(); |
| 577 } | 577 } |
| 578 | 578 |
| 579 void VrShell::ExitFullscreen() { | 579 void VrShell::ExitFullscreen() { |
| 580 if (web_contents_ && web_contents_->IsFullscreen()) { | 580 if (web_contents_ && web_contents_->IsFullscreen()) { |
| 581 web_contents_->ExitFullscreen(false); | 581 web_contents_->ExitFullscreen(false); |
| 582 } | 582 } |
| 583 } | 583 } |
| 584 | 584 |
| 585 void VrShell::ExitVrDueToUnsupportedMode() { | 585 void VrShell::ExitVrDueToUnsupportedMode(UiUnsupportedMode mode) { |
| 586 ui_->SetIsExiting(); | 586 ui_->SetIsExiting(); |
| 587 main_thread_task_runner_->PostDelayedTask( | 587 main_thread_task_runner_->PostDelayedTask( |
| 588 FROM_HERE, | 588 FROM_HERE, |
| 589 base::Bind(&VrShell::ForceExitVr, weak_ptr_factory_.GetWeakPtr()), | 589 base::Bind(&VrShell::ForceExitVr, weak_ptr_factory_.GetWeakPtr()), |
| 590 kExitVrDueToUnsupportedModeDelay); | 590 kExitVrDueToUnsupportedModeDelay); |
| 591 UMA_HISTOGRAM_ENUMERATION("VR.Shell.EncounteredUnsupportedMode", mode, |
| 592 UiUnsupportedMode::kCount); |
| 591 } | 593 } |
| 592 | 594 |
| 593 void VrShell::OnVRVsyncProviderRequest( | 595 void VrShell::OnVRVsyncProviderRequest( |
| 594 device::mojom::VRVSyncProviderRequest request) { | 596 device::mojom::VRVSyncProviderRequest request) { |
| 595 WaitForGlThread(); | 597 WaitForGlThread(); |
| 596 PostToGlThread(FROM_HERE, | 598 PostToGlThread(FROM_HERE, |
| 597 base::Bind(&VrShellGl::OnRequest, gl_thread_->GetVrShellGl(), | 599 base::Bind(&VrShellGl::OnRequest, gl_thread_->GetVrShellGl(), |
| 598 base::Passed(&request))); | 600 base::Passed(&request))); |
| 599 } | 601 } |
| 600 | 602 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 jlong gvr_api, | 713 jlong gvr_api, |
| 712 jboolean reprojected_rendering) { | 714 jboolean reprojected_rendering) { |
| 713 return reinterpret_cast<intptr_t>(new VrShell( | 715 return reinterpret_cast<intptr_t>(new VrShell( |
| 714 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 716 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 715 for_web_vr, in_cct, | 717 for_web_vr, in_cct, |
| 716 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 718 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 717 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 719 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 718 } | 720 } |
| 719 | 721 |
| 720 } // namespace vr_shell | 722 } // namespace vr_shell |
| OLD | NEW |