| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 delegate_provider_->ExitWebVRPresent(); | 578 delegate_provider_->ExitWebVRPresent(); |
| 579 } | 579 } |
| 580 | 580 |
| 581 void VrShell::ExitFullscreen() { | 581 void VrShell::ExitFullscreen() { |
| 582 if (web_contents_ && web_contents_->IsFullscreen()) { | 582 if (web_contents_ && web_contents_->IsFullscreen()) { |
| 583 web_contents_->ExitFullscreen(false); | 583 web_contents_->ExitFullscreen(false); |
| 584 } | 584 } |
| 585 } | 585 } |
| 586 | 586 |
| 587 void VrShell::ExitVrDueToUnsupportedMode(UiUnsupportedMode mode) { | 587 void VrShell::ExitVrDueToUnsupportedMode(UiUnsupportedMode mode) { |
| 588 if (mode == UiUnsupportedMode::kUnhandledPageInfo) { |
| 589 UMA_HISTOGRAM_ENUMERATION("VR.Shell.EncounteredUnsupportedMode", mode, |
| 590 UiUnsupportedMode::kCount); |
| 591 JNIEnv* env = base::android::AttachCurrentThread(); |
| 592 Java_VrShellImpl_onUnhandledPageInfo(env, j_vr_shell_.obj()); |
| 593 return; |
| 594 } |
| 588 ui_->SetIsExiting(); | 595 ui_->SetIsExiting(); |
| 589 main_thread_task_runner_->PostDelayedTask( | 596 main_thread_task_runner_->PostDelayedTask( |
| 590 FROM_HERE, | 597 FROM_HERE, |
| 591 base::Bind(&VrShell::ForceExitVr, weak_ptr_factory_.GetWeakPtr()), | 598 base::Bind(&VrShell::ForceExitVr, weak_ptr_factory_.GetWeakPtr()), |
| 592 kExitVrDueToUnsupportedModeDelay); | 599 kExitVrDueToUnsupportedModeDelay); |
| 593 UMA_HISTOGRAM_ENUMERATION("VR.Shell.EncounteredUnsupportedMode", mode, | 600 UMA_HISTOGRAM_ENUMERATION("VR.Shell.EncounteredUnsupportedMode", mode, |
| 594 UiUnsupportedMode::kCount); | 601 UiUnsupportedMode::kCount); |
| 595 } | 602 } |
| 596 | 603 |
| 597 void VrShell::OnVRVsyncProviderRequest( | 604 void VrShell::OnVRVsyncProviderRequest( |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 jlong gvr_api, | 734 jlong gvr_api, |
| 728 jboolean reprojected_rendering) { | 735 jboolean reprojected_rendering) { |
| 729 return reinterpret_cast<intptr_t>(new VrShell( | 736 return reinterpret_cast<intptr_t>(new VrShell( |
| 730 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 737 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 731 for_web_vr, in_cct, | 738 for_web_vr, in_cct, |
| 732 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 739 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 733 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 740 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 734 } | 741 } |
| 735 | 742 |
| 736 } // namespace vr_shell | 743 } // namespace vr_shell |
| OLD | NEW |