| 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_gl_thread.h" | 5 #include "chrome/browser/android/vr_shell/vr_gl_thread.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/android/vr_shell/ui_interface.h" | 9 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 10 #include "chrome/browser/android/vr_shell/ui_scene.h" | 10 #include "chrome/browser/android/vr_shell/ui_scene.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 main_thread_task_runner_->PostTask( | 107 main_thread_task_runner_->PostTask( |
| 108 FROM_HERE, | 108 FROM_HERE, |
| 109 base::Bind(&VrShell::OnContentPaused, weak_vr_shell_, enabled)); | 109 base::Bind(&VrShell::OnContentPaused, weak_vr_shell_, enabled)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void VrGLThread::NavigateBack() { | 112 void VrGLThread::NavigateBack() { |
| 113 main_thread_task_runner_->PostTask( | 113 main_thread_task_runner_->PostTask( |
| 114 FROM_HERE, base::Bind(&VrShell::NavigateBack, weak_vr_shell_)); | 114 FROM_HERE, base::Bind(&VrShell::NavigateBack, weak_vr_shell_)); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void VrGLThread::ToggleCardboardGamepad(bool enabled) { |
| 118 main_thread_task_runner_->PostTask( |
| 119 FROM_HERE, |
| 120 base::Bind(&VrShell::ToggleCardboardGamepad, weak_vr_shell_, enabled)); |
| 121 } |
| 122 |
| 117 void VrGLThread::SetFullscreen(bool enabled) { | 123 void VrGLThread::SetFullscreen(bool enabled) { |
| 118 WaitUntilThreadStarted(); | 124 WaitUntilThreadStarted(); |
| 119 task_runner()->PostTask(FROM_HERE, base::Bind(&UiSceneManager::SetFullscreen, | 125 task_runner()->PostTask(FROM_HERE, base::Bind(&UiSceneManager::SetFullscreen, |
| 120 weak_scene_manager_, enabled)); | 126 weak_scene_manager_, enabled)); |
| 121 } | 127 } |
| 122 | 128 |
| 123 void VrGLThread::SetHistoryButtonsEnabled(bool can_go_back, | 129 void VrGLThread::SetHistoryButtonsEnabled(bool can_go_back, |
| 124 bool can_go_forward) { | 130 bool can_go_forward) { |
| 125 WaitUntilThreadStarted(); | 131 WaitUntilThreadStarted(); |
| 126 task_runner()->PostTask( | 132 task_runner()->PostTask( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 weak_scene_manager_, secure)); | 173 weak_scene_manager_, secure)); |
| 168 } | 174 } |
| 169 | 175 |
| 170 void VrGLThread::CleanUp() { | 176 void VrGLThread::CleanUp() { |
| 171 scene_manager_.reset(); | 177 scene_manager_.reset(); |
| 172 vr_shell_gl_.reset(); | 178 vr_shell_gl_.reset(); |
| 173 scene_.reset(); | 179 scene_.reset(); |
| 174 } | 180 } |
| 175 | 181 |
| 176 } // namespace vr_shell | 182 } // namespace vr_shell |
| OLD | NEW |