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

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

Issue 2889693005: Stay in VR while showing DOFF flow and connect CCT exit button to this. (Closed)
Patch Set: rebase 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
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 delegate_provider_->device_provider()->Device()->OnBlur(); 251 delegate_provider_->device_provider()->Device()->OnBlur();
252 else 252 else
253 delegate_provider_->device_provider()->Device()->OnFocus(); 253 delegate_provider_->device_provider()->Device()->OnFocus();
254 } 254 }
255 255
256 void VrShell::NavigateBack() { 256 void VrShell::NavigateBack() {
257 JNIEnv* env = base::android::AttachCurrentThread(); 257 JNIEnv* env = base::android::AttachCurrentThread();
258 Java_VrShellImpl_navigateBack(env, j_vr_shell_.obj()); 258 Java_VrShellImpl_navigateBack(env, j_vr_shell_.obj());
259 } 259 }
260 260
261 void VrShell::ExitCct() {
262 JNIEnv* env = base::android::AttachCurrentThread();
263 Java_VrShellImpl_exitCct(env, j_vr_shell_.obj());
264 }
265
261 void VrShell::OnTriggerEvent(JNIEnv* env, const JavaParamRef<jobject>& obj) { 266 void VrShell::OnTriggerEvent(JNIEnv* env, const JavaParamRef<jobject>& obj) {
262 WaitForGlThread(); 267 WaitForGlThread();
263 PostToGlThread(FROM_HERE, base::Bind(&VrShellGl::OnTriggerEvent, 268 PostToGlThread(FROM_HERE, base::Bind(&VrShellGl::OnTriggerEvent,
264 gl_thread_->GetVrShellGl())); 269 gl_thread_->GetVrShellGl()));
265 } 270 }
266 271
267 void VrShell::OnPause(JNIEnv* env, const JavaParamRef<jobject>& obj) { 272 void VrShell::OnPause(JNIEnv* env, const JavaParamRef<jobject>& obj) {
268 WaitForGlThread(); 273 WaitForGlThread();
269 PostToGlThread(FROM_HERE, 274 PostToGlThread(FROM_HERE,
270 base::Bind(&VrShellGl::OnPause, gl_thread_->GetVrShellGl())); 275 base::Bind(&VrShellGl::OnPause, gl_thread_->GetVrShellGl()));
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 jlong gvr_api, 655 jlong gvr_api,
651 jboolean reprojected_rendering) { 656 jboolean reprojected_rendering) {
652 return reinterpret_cast<intptr_t>(new VrShell( 657 return reinterpret_cast<intptr_t>(new VrShell(
653 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), 658 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android),
654 for_web_vr, in_cct, 659 for_web_vr, in_cct,
655 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), 660 VrShellDelegate::GetNativeVrShellDelegate(env, delegate),
656 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); 661 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering));
657 } 662 }
658 663
659 } // namespace vr_shell 664 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/android/vr_shell/vr_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698