| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 metrics_helper_->SetWebVREnabled(enabled); | 269 metrics_helper_->SetWebVREnabled(enabled); |
| 270 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetWebVrMode, | 270 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetWebVrMode, |
| 271 gl_thread_->GetVrShellGl(), enabled)); | 271 gl_thread_->GetVrShellGl(), enabled)); |
| 272 | 272 |
| 273 ui_->SetMode(enabled ? UiInterface::Mode::WEB_VR | 273 ui_->SetMode(enabled ? UiInterface::Mode::WEB_VR |
| 274 : UiInterface::Mode::STANDARD); | 274 : UiInterface::Mode::STANDARD); |
| 275 PostToGlThreadWhenReady(base::Bind(&UiSceneManager::SetWebVRMode, | 275 PostToGlThreadWhenReady(base::Bind(&UiSceneManager::SetWebVRMode, |
| 276 gl_thread_->GetSceneManager(), enabled)); | 276 gl_thread_->GetSceneManager(), enabled)); |
| 277 } | 277 } |
| 278 | 278 |
| 279 bool VrShell::GetWebVrMode(JNIEnv* env, |
| 280 const base::android::JavaParamRef<jobject>& obj) { |
| 281 return webvr_mode_; |
| 282 } |
| 283 |
| 279 void VrShell::OnLoadProgressChanged(JNIEnv* env, | 284 void VrShell::OnLoadProgressChanged(JNIEnv* env, |
| 280 const JavaParamRef<jobject>& obj, | 285 const JavaParamRef<jobject>& obj, |
| 281 double progress) { | 286 double progress) { |
| 282 ui_->SetLoadProgress(progress); | 287 ui_->SetLoadProgress(progress); |
| 283 } | 288 } |
| 284 | 289 |
| 285 void VrShell::OnTabListCreated(JNIEnv* env, | 290 void VrShell::OnTabListCreated(JNIEnv* env, |
| 286 const JavaParamRef<jobject>& obj, | 291 const JavaParamRef<jobject>& obj, |
| 287 jobjectArray tabs, | 292 jobjectArray tabs, |
| 288 jobjectArray incognito_tabs) { | 293 jobjectArray incognito_tabs) { |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 jboolean for_web_vr, | 570 jboolean for_web_vr, |
| 566 jlong gvr_api, | 571 jlong gvr_api, |
| 567 jboolean reprojected_rendering) { | 572 jboolean reprojected_rendering) { |
| 568 return reinterpret_cast<intptr_t>(new VrShell( | 573 return reinterpret_cast<intptr_t>(new VrShell( |
| 569 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 574 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 570 for_web_vr, VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 575 for_web_vr, VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 571 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 576 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 572 } | 577 } |
| 573 | 578 |
| 574 } // namespace vr_shell | 579 } // namespace vr_shell |
| OLD | NEW |