| 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_UI_SCENE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 namespace vr_shell { | 14 namespace vr_shell { |
| 14 | 15 |
| 15 class UiElement; | 16 class UiElement; |
| 16 class UiScene; | 17 class UiScene; |
| 18 class UrlBar; |
| 17 class VrBrowserInterface; | 19 class VrBrowserInterface; |
| 18 | 20 |
| 19 class UiSceneManager { | 21 class UiSceneManager { |
| 20 public: | 22 public: |
| 21 UiSceneManager(VrBrowserInterface* browser, UiScene* scene, bool in_cct); | 23 UiSceneManager(VrBrowserInterface* browser, UiScene* scene, bool in_cct); |
| 22 ~UiSceneManager(); | 24 ~UiSceneManager(); |
| 23 | 25 |
| 24 base::WeakPtr<UiSceneManager> GetWeakPtr(); | 26 base::WeakPtr<UiSceneManager> GetWeakPtr(); |
| 25 | 27 |
| 26 void SetWebVRSecureOrigin(bool secure); | 28 void SetWebVRSecureOrigin(bool secure); |
| 27 void SetWebVRMode(bool web_vr); | 29 void SetWebVRMode(bool web_vr); |
| 28 | 30 |
| 29 void OnAppButtonClicked(); | 31 void OnAppButtonClicked(); |
| 32 void OnUrlChange(const GURL& gurl); |
| 30 | 33 |
| 31 private: | 34 private: |
| 32 void CreateSecurityWarnings(); | 35 void CreateSecurityWarnings(); |
| 33 void CreateContentQuad(); | 36 void CreateContentQuad(); |
| 34 void CreateBackground(); | 37 void CreateBackground(); |
| 38 void CreateUrlBar(); |
| 35 | 39 |
| 36 void ConfigureSecurityWarnings(); | 40 void ConfigureSecurityWarnings(); |
| 37 void OnSecurityWarningTimer(); | 41 void OnSecurityWarningTimer(); |
| 38 int AllocateId(); | 42 int AllocateId(); |
| 39 | 43 |
| 40 VrBrowserInterface* browser_; | 44 VrBrowserInterface* browser_; |
| 41 UiScene* scene_; | 45 UiScene* scene_; |
| 42 | 46 |
| 43 // UI element pointers (not owned by the scene manager). | 47 // UI element pointers (not owned by the scene manager). |
| 44 UiElement* permanent_security_warning_ = nullptr; | 48 UiElement* permanent_security_warning_ = nullptr; |
| 45 UiElement* transient_security_warning_ = nullptr; | 49 UiElement* transient_security_warning_ = nullptr; |
| 46 UiElement* main_content_ = nullptr; | 50 UiElement* main_content_ = nullptr; |
| 51 UrlBar* url_bar_ = nullptr; |
| 47 | 52 |
| 48 bool web_vr_mode_ = false; | 53 bool web_vr_mode_ = false; |
| 49 bool secure_origin_ = false; | 54 bool secure_origin_ = false; |
| 50 bool content_rendering_enabled_ = true; | 55 bool content_rendering_enabled_ = true; |
| 51 bool in_cct_; | 56 bool in_cct_; |
| 52 | 57 |
| 53 int next_available_id_ = 1; | 58 int next_available_id_ = 1; |
| 54 | 59 |
| 55 std::vector<UiElement*> browser_ui_elements_; | 60 std::vector<UiElement*> browser_ui_elements_; |
| 56 | 61 |
| 57 base::OneShotTimer security_warning_timer_; | 62 base::OneShotTimer security_warning_timer_; |
| 58 | 63 |
| 59 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; | 64 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; |
| 60 | 65 |
| 61 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); | 66 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); |
| 62 }; | 67 }; |
| 63 | 68 |
| 64 } // namespace vr_shell | 69 } // namespace vr_shell |
| 65 | 70 |
| 66 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 71 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| OLD | NEW |