| 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 | 12 |
| 13 namespace vr_shell { | 13 namespace vr_shell { |
| 14 | 14 |
| 15 struct UiElement; | 15 struct UiElement; |
| 16 class UiScene; | 16 class UiScene; |
| 17 class VrBrowserInterface; |
| 17 | 18 |
| 18 class UiSceneManager { | 19 class UiSceneManager { |
| 19 public: | 20 public: |
| 20 explicit UiSceneManager(UiScene* scene); | 21 UiSceneManager(VrBrowserInterface* browser, UiScene* scene); |
| 21 ~UiSceneManager(); | 22 ~UiSceneManager(); |
| 22 | 23 |
| 23 base::WeakPtr<UiSceneManager> GetWeakPtr(); | 24 base::WeakPtr<UiSceneManager> GetWeakPtr(); |
| 24 | 25 |
| 25 void SetWebVRSecureOrigin(bool secure); | 26 void SetWebVRSecureOrigin(bool secure); |
| 26 void SetWebVRMode(bool web_vr); | 27 void SetWebVRMode(bool web_vr); |
| 27 | 28 |
| 29 void OnAppButtonClicked(); |
| 30 |
| 28 private: | 31 private: |
| 29 void CreateSecurityWarnings(); | 32 void CreateSecurityWarnings(); |
| 30 void CreateContentQuad(); | 33 void CreateContentQuad(); |
| 31 void CreateBackground(); | 34 void CreateBackground(); |
| 32 | 35 |
| 33 void ConfigureSecurityWarnings(); | 36 void ConfigureSecurityWarnings(); |
| 34 void OnSecurityWarningTimer(); | 37 void OnSecurityWarningTimer(); |
| 35 int AllocateId(); | 38 int AllocateId(); |
| 36 | 39 |
| 40 VrBrowserInterface* browser_; |
| 37 UiScene* scene_; | 41 UiScene* scene_; |
| 38 | 42 |
| 39 // UI element pointers (not owned by the scene manager). | 43 // UI element pointers (not owned by the scene manager). |
| 40 UiElement* permanent_security_warning_ = nullptr; | 44 UiElement* permanent_security_warning_ = nullptr; |
| 41 UiElement* transient_security_warning_ = nullptr; | 45 UiElement* transient_security_warning_ = nullptr; |
| 42 UiElement* main_content_ = nullptr; | 46 UiElement* main_content_ = nullptr; |
| 43 | 47 |
| 44 bool web_vr_mode_ = false; | 48 bool web_vr_mode_ = false; |
| 45 bool secure_origin_ = false; | 49 bool secure_origin_ = false; |
| 50 bool content_rendering_enabled_ = true; |
| 46 | 51 |
| 47 int next_available_id_ = 1; | 52 int next_available_id_ = 1; |
| 48 | 53 |
| 49 std::vector<UiElement*> browser_ui_elements_; | 54 std::vector<UiElement*> browser_ui_elements_; |
| 50 | 55 |
| 51 base::OneShotTimer security_warning_timer_; | 56 base::OneShotTimer security_warning_timer_; |
| 52 | 57 |
| 53 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; | 58 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; |
| 54 | 59 |
| 55 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); | 60 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); |
| 56 }; | 61 }; |
| 57 | 62 |
| 58 } // namespace vr_shell | 63 } // namespace vr_shell |
| 59 | 64 |
| 60 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 65 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| OLD | NEW |