| 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/toolbar_state.h" |
| 9 #include "chrome/browser/android/vr_shell/ui_interface.h" | 10 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 10 #include "chrome/browser/android/vr_shell/ui_scene.h" | 11 #include "chrome/browser/android/vr_shell/ui_scene.h" |
| 11 #include "chrome/browser/android/vr_shell/ui_scene_manager.h" | 12 #include "chrome/browser/android/vr_shell/ui_scene_manager.h" |
| 12 #include "chrome/browser/android/vr_shell/vr_input_manager.h" | 13 #include "chrome/browser/android/vr_shell/vr_input_manager.h" |
| 13 #include "chrome/browser/android/vr_shell/vr_shell.h" | 14 #include "chrome/browser/android/vr_shell/vr_shell.h" |
| 14 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" | 15 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" |
| 15 | 16 |
| 16 namespace vr_shell { | 17 namespace vr_shell { |
| 17 | 18 |
| 18 VrGLThread::VrGLThread( | 19 VrGLThread::VrGLThread( |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 base::Bind(&UiSceneManager::SetLoadProgress, | 171 base::Bind(&UiSceneManager::SetLoadProgress, |
| 171 weak_scene_manager_, progress)); | 172 weak_scene_manager_, progress)); |
| 172 } | 173 } |
| 173 | 174 |
| 174 void VrGLThread::SetLoading(bool loading) { | 175 void VrGLThread::SetLoading(bool loading) { |
| 175 WaitUntilThreadStarted(); | 176 WaitUntilThreadStarted(); |
| 176 task_runner()->PostTask(FROM_HERE, base::Bind(&UiSceneManager::SetLoading, | 177 task_runner()->PostTask(FROM_HERE, base::Bind(&UiSceneManager::SetLoading, |
| 177 weak_scene_manager_, loading)); | 178 weak_scene_manager_, loading)); |
| 178 } | 179 } |
| 179 | 180 |
| 180 void VrGLThread::SetSecurityInfo(security_state::SecurityLevel level, | 181 void VrGLThread::SetToolbarState(const ToolbarState& state) { |
| 181 bool malware) { | |
| 182 WaitUntilThreadStarted(); | 182 WaitUntilThreadStarted(); |
| 183 task_runner()->PostTask(FROM_HERE, | 183 task_runner()->PostTask( |
| 184 base::Bind(&UiSceneManager::SetSecurityInfo, | 184 FROM_HERE, |
| 185 weak_scene_manager_, level, malware)); | 185 base::Bind(&UiSceneManager::SetToolbarState, weak_scene_manager_, state)); |
| 186 } | |
| 187 | |
| 188 void VrGLThread::SetURL(const GURL& gurl) { | |
| 189 WaitUntilThreadStarted(); | |
| 190 task_runner()->PostTask(FROM_HERE, base::Bind(&UiSceneManager::SetURL, | |
| 191 weak_scene_manager_, gurl)); | |
| 192 } | 186 } |
| 193 | 187 |
| 194 void VrGLThread::SetWebVrMode(bool enabled, | 188 void VrGLThread::SetWebVrMode(bool enabled, |
| 195 bool auto_presented, | 189 bool auto_presented, |
| 196 bool show_toast) { | 190 bool show_toast) { |
| 197 WaitUntilThreadStarted(); | 191 WaitUntilThreadStarted(); |
| 198 task_runner()->PostTask( | 192 task_runner()->PostTask( |
| 199 FROM_HERE, base::Bind(&UiSceneManager::SetWebVrMode, weak_scene_manager_, | 193 FROM_HERE, base::Bind(&UiSceneManager::SetWebVrMode, weak_scene_manager_, |
| 200 enabled, auto_presented, show_toast)); | 194 enabled, auto_presented, show_toast)); |
| 201 } | 195 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 231 weak_scene_manager_)); | 225 weak_scene_manager_)); |
| 232 } | 226 } |
| 233 | 227 |
| 234 void VrGLThread::CleanUp() { | 228 void VrGLThread::CleanUp() { |
| 235 scene_manager_.reset(); | 229 scene_manager_.reset(); |
| 236 vr_shell_gl_.reset(); | 230 vr_shell_gl_.reset(); |
| 237 scene_.reset(); | 231 scene_.reset(); |
| 238 } | 232 } |
| 239 | 233 |
| 240 } // namespace vr_shell | 234 } // namespace vr_shell |
| OLD | NEW |