Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_shell.cc |
| diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc |
| index 1728f275f21723f827e5d50fcb30fa449cf2f425..a756afb1acd9effe535e977b905275f37e6f8d0d 100644 |
| --- a/chrome/browser/android/vr_shell/vr_shell.cc |
| +++ b/chrome/browser/android/vr_shell/vr_shell.cc |
| @@ -82,17 +82,6 @@ void SetIsInVR(content::WebContents* contents, bool is_in_vr) { |
| } |
| } |
| -void LoadControllerModelTask( |
| - base::WeakPtr<VrShell> weak_vr_shell, |
| - scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { |
| - auto controller_model = VrControllerModel::LoadFromComponent(); |
| - if (controller_model) { |
| - main_thread_task_runner->PostTask( |
| - FROM_HERE, base::Bind(&VrShell::SubmitControllerModel, weak_vr_shell, |
| - base::Passed(&controller_model))); |
| - } |
| -} |
| - |
| } // namespace |
| VrShell::VrShell(JNIEnv* env, |
| @@ -118,18 +107,12 @@ VrShell::VrShell(JNIEnv* env, |
| gl_thread_ = base::MakeUnique<VrGLThread>( |
| weak_ptr_factory_.GetWeakPtr(), main_thread_task_runner_, gvr_api, |
| - for_web_vr, in_cct, reprojected_rendering_); |
| + for_web_vr, in_cct, reprojected_rendering_, HasDaydreamSupport()); |
| ui_ = gl_thread_.get(); |
| base::Thread::Options options(base::MessageLoop::TYPE_DEFAULT, 0); |
| options.priority = base::ThreadPriority::DISPLAY; |
| gl_thread_->StartWithOptions(options); |
| - |
| - |
| - content::BrowserThread::PostTask( |
| - content::BrowserThread::FILE, FROM_HERE, |
| - base::Bind(LoadControllerModelTask, weak_ptr_factory_.GetWeakPtr(), |
| - main_thread_task_runner_)); |
| } |
| void VrShell::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| @@ -371,13 +354,6 @@ void VrShell::SubmitWebVRFrame(int16_t frame_index, |
| gl_thread_->GetVrShellGl(), frame_index, mailbox)); |
| } |
| -void VrShell::SubmitControllerModel(std::unique_ptr<VrControllerModel> model) { |
| - WaitForGlThread(); |
| - PostToGlThread(FROM_HERE, |
| - base::Bind(&VrShellGl::SetControllerModel, |
| - gl_thread_->GetVrShellGl(), base::Passed(&model))); |
| -} |
| - |
| void VrShell::UpdateWebVRTextureBounds(int16_t frame_index, |
| const gfx::RectF& left_bounds, |
| const gfx::RectF& right_bounds, |
| @@ -626,6 +602,11 @@ void VrShell::RegisterGamepadDataFetcher( |
| gamepad_data_fetcher_ = fetcher; |
| } |
| +bool VrShell::HasDaydreamSupport() { |
| + JNIEnv* env = base::android::AttachCurrentThread(); |
|
mthiesse
2017/05/19 14:32:42
nit: take env as an argument, since the callsite a
acondor_
2017/05/19 16:06:49
Done.
|
| + return Java_VrShellImpl_hasDaydreamSupport(env, j_vr_shell_.obj()); |
| +} |
| + |
| // ---------------------------------------------------------------------------- |
| // Native JNI methods |
| // ---------------------------------------------------------------------------- |