| 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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class VrGLThread : public base::Thread, | 28 class VrGLThread : public base::Thread, |
| 29 public GlBrowserInterface, | 29 public GlBrowserInterface, |
| 30 public UiBrowserInterface, | 30 public UiBrowserInterface, |
| 31 public UiInterface { | 31 public UiInterface { |
| 32 public: | 32 public: |
| 33 VrGLThread( | 33 VrGLThread( |
| 34 const base::WeakPtr<VrShell>& weak_vr_shell, | 34 const base::WeakPtr<VrShell>& weak_vr_shell, |
| 35 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, | 35 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, |
| 36 gvr_context* gvr_api, | 36 gvr_context* gvr_api, |
| 37 bool initially_web_vr, | 37 bool initially_web_vr, |
| 38 bool web_vr_autopresented, | 38 bool web_vr_autopresentation_expected, |
| 39 bool in_cct, | 39 bool in_cct, |
| 40 bool reprojected_rendering, | 40 bool reprojected_rendering, |
| 41 bool daydream_support); | 41 bool daydream_support); |
| 42 | 42 |
| 43 ~VrGLThread() override; | 43 ~VrGLThread() override; |
| 44 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } | 44 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } |
| 45 base::WeakPtr<UiSceneManager> GetSceneManager() { | 45 base::WeakPtr<UiSceneManager> GetSceneManager() { |
| 46 return weak_scene_manager_; | 46 return weak_scene_manager_; |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 71 | 71 |
| 72 // UiInterface implementation (VrShell and GL calling to the UI). | 72 // UiInterface implementation (VrShell and GL calling to the UI). |
| 73 void SetFullscreen(bool enabled) override; | 73 void SetFullscreen(bool enabled) override; |
| 74 void SetIncognito(bool incognito) override; | 74 void SetIncognito(bool incognito) override; |
| 75 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward) override; | 75 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward) override; |
| 76 void SetLoadProgress(float progress) override; | 76 void SetLoadProgress(float progress) override; |
| 77 void SetLoading(bool loading) override; | 77 void SetLoading(bool loading) override; |
| 78 void SetSecurityInfo(security_state::SecurityLevel level, | 78 void SetSecurityInfo(security_state::SecurityLevel level, |
| 79 bool malware) override; | 79 bool malware) override; |
| 80 void SetURL(const GURL& gurl) override; | 80 void SetURL(const GURL& gurl) override; |
| 81 void SetWebVrMode(bool enabled, | 81 void SetWebVrMode(bool enabled, bool show_toast) override; |
| 82 bool auto_presented, | |
| 83 bool show_toast) override; | |
| 84 void SetWebVrSecureOrigin(bool secure) override; | 82 void SetWebVrSecureOrigin(bool secure) override; |
| 85 void SetVideoCapturingIndicator(bool enabled) override; | 83 void SetVideoCapturingIndicator(bool enabled) override; |
| 86 void SetScreenCapturingIndicator(bool enabled) override; | 84 void SetScreenCapturingIndicator(bool enabled) override; |
| 87 void SetAudioCapturingIndicator(bool enabled) override; | 85 void SetAudioCapturingIndicator(bool enabled) override; |
| 88 void SetIsExiting() override; | 86 void SetIsExiting() override; |
| 87 void SetSplashScreenIcon(const SkBitmap& bitmap) override; |
| 89 | 88 |
| 90 protected: | 89 protected: |
| 91 void Init() override; | 90 void Init() override; |
| 92 void CleanUp() override; | 91 void CleanUp() override; |
| 93 | 92 |
| 94 private: | 93 private: |
| 95 // Created on GL thread. | 94 // Created on GL thread. |
| 96 std::unique_ptr<UiScene> scene_; | 95 std::unique_ptr<UiScene> scene_; |
| 97 std::unique_ptr<UiSceneManager> scene_manager_; | 96 std::unique_ptr<UiSceneManager> scene_manager_; |
| 98 base::WeakPtr<UiSceneManager> weak_scene_manager_; | 97 base::WeakPtr<UiSceneManager> weak_scene_manager_; |
| 99 std::unique_ptr<VrShellGl> vr_shell_gl_; | 98 std::unique_ptr<VrShellGl> vr_shell_gl_; |
| 100 base::WeakPtr<VrShellGl> weak_vr_shell_gl_; | 99 base::WeakPtr<VrShellGl> weak_vr_shell_gl_; |
| 101 | 100 |
| 102 // This state is used for initializing vr_shell_gl_. | 101 // This state is used for initializing vr_shell_gl_. |
| 103 base::WeakPtr<VrShell> weak_vr_shell_; | 102 base::WeakPtr<VrShell> weak_vr_shell_; |
| 104 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 103 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 105 gvr_context* gvr_api_; | 104 gvr_context* gvr_api_; |
| 106 bool initially_web_vr_; | 105 bool initially_web_vr_; |
| 107 bool web_vr_autopresented_; | 106 bool web_vr_autopresentation_expected_; |
| 108 bool in_cct_; | 107 bool in_cct_; |
| 109 bool reprojected_rendering_; | 108 bool reprojected_rendering_; |
| 110 bool daydream_support_; | 109 bool daydream_support_; |
| 111 | 110 |
| 112 DISALLOW_COPY_AND_ASSIGN(VrGLThread); | 111 DISALLOW_COPY_AND_ASSIGN(VrGLThread); |
| 113 }; | 112 }; |
| 114 | 113 |
| 115 } // namespace vr_shell | 114 } // namespace vr_shell |
| 116 | 115 |
| 117 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ | 116 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |
| OLD | NEW |