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

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

Issue 2684233003: Switch tabs from VR shell. (Closed)
Patch Set: Created 3 years, 10 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_delegate.h" 5 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h" 8 #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h"
9 #include "device/vr/android/gvr/gvr_device.h" 9 #include "device/vr/android/gvr/gvr_device.h"
10 #include "device/vr/android/gvr/gvr_device_provider.h" 10 #include "device/vr/android/gvr/gvr_device_provider.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 } 110 }
111 111
112 void VrShellDelegate::OnResume(JNIEnv* env, 112 void VrShellDelegate::OnResume(JNIEnv* env,
113 const JavaParamRef<jobject>& obj) { 113 const JavaParamRef<jobject>& obj) {
114 if (non_presenting_delegate_) { 114 if (non_presenting_delegate_) {
115 non_presenting_delegate_->Resume(); 115 non_presenting_delegate_->Resume();
116 } 116 }
117 } 117 }
118 118
119 void VrShellDelegate::ShowTab(int id) {
120 JNIEnv* env = AttachCurrentThread();
121 Java_VrShellDelegate_showTab(env, j_vr_shell_delegate_.obj(), id);
122 }
123
119 void VrShellDelegate::SetDeviceProvider( 124 void VrShellDelegate::SetDeviceProvider(
120 device::GvrDeviceProvider* device_provider) { 125 device::GvrDeviceProvider* device_provider) {
121 CHECK(!device_provider_); 126 CHECK(!device_provider_);
122 device_provider_ = device_provider; 127 device_provider_ = device_provider;
123 if (!delegate_) 128 if (!delegate_)
124 CreateNonPresentingDelegate(); 129 CreateNonPresentingDelegate();
125 device_provider_->Device()->OnDelegateChanged(); 130 device_provider_->Device()->OnDelegateChanged();
126 } 131 }
127 132
128 void VrShellDelegate::ClearDeviceProvider() { 133 void VrShellDelegate::ClearDeviceProvider() {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 203
199 bool RegisterVrShellDelegate(JNIEnv* env) { 204 bool RegisterVrShellDelegate(JNIEnv* env) {
200 return RegisterNativesImpl(env); 205 return RegisterNativesImpl(env);
201 } 206 }
202 207
203 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 208 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
204 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); 209 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj));
205 } 210 }
206 211
207 } // namespace vr_shell 212 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698