| 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 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 13 |
| 14 class GURL; |
| 13 | 15 |
| 14 namespace vr_shell { | 16 namespace vr_shell { |
| 15 | 17 |
| 16 class UiElement; | 18 class UiElement; |
| 17 class UiScene; | 19 class UiScene; |
| 18 class UrlBar; | 20 class UrlBar; |
| 19 class VrBrowserInterface; | 21 class VrBrowserInterface; |
| 20 | 22 |
| 21 class UiSceneManager { | 23 class UiSceneManager { |
| 22 public: | 24 public: |
| 23 UiSceneManager(VrBrowserInterface* browser, UiScene* scene, bool in_cct); | 25 UiSceneManager(VrBrowserInterface* browser, |
| 26 UiScene* scene, |
| 27 bool in_cct, |
| 28 bool in_web_vr); |
| 24 ~UiSceneManager(); | 29 ~UiSceneManager(); |
| 25 | 30 |
| 26 base::WeakPtr<UiSceneManager> GetWeakPtr(); | 31 base::WeakPtr<UiSceneManager> GetWeakPtr(); |
| 27 | 32 |
| 28 void SetWebVRSecureOrigin(bool secure); | 33 void SetFullscreen(bool fullscreen); |
| 29 void SetWebVRMode(bool web_vr); | 34 void SetURL(const GURL& gurl); |
| 35 void SetWebVrSecureOrigin(bool secure); |
| 36 void SetWebVrMode(bool web_vr); |
| 37 // These methods are currently stubbed. |
| 38 void SetSecurityLevel(int level); |
| 39 void SetLoading(bool loading); |
| 40 void SetLoadProgress(double progress); |
| 41 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward); |
| 30 | 42 |
| 31 void OnAppButtonClicked(); | 43 void OnAppButtonClicked(); |
| 32 void OnUrlChange(const GURL& gurl); | 44 void OnAppButtonGesturePerformed(UiInterface::Direction direction); |
| 33 void OnFullscreenChanged(bool fullscreen); | |
| 34 | 45 |
| 35 private: | 46 private: |
| 36 void CreateSecurityWarnings(); | 47 void CreateSecurityWarnings(); |
| 37 void CreateContentQuad(); | 48 void CreateContentQuad(); |
| 38 void CreateBackground(); | 49 void CreateBackground(); |
| 39 void CreateUrlBar(); | 50 void CreateUrlBar(); |
| 40 | 51 |
| 41 void ConfigureSecurityWarnings(); | 52 void ConfigureSecurityWarnings(); |
| 42 void OnSecurityWarningTimer(); | 53 void OnSecurityWarningTimer(); |
| 43 int AllocateId(); | 54 int AllocateId(); |
| 44 | 55 |
| 45 VrBrowserInterface* browser_; | 56 VrBrowserInterface* browser_; |
| 46 UiScene* scene_; | 57 UiScene* scene_; |
| 47 | 58 |
| 48 // UI element pointers (not owned by the scene manager). | 59 // UI element pointers (not owned by the scene manager). |
| 49 UiElement* permanent_security_warning_ = nullptr; | 60 UiElement* permanent_security_warning_ = nullptr; |
| 50 UiElement* transient_security_warning_ = nullptr; | 61 UiElement* transient_security_warning_ = nullptr; |
| 51 UiElement* main_content_ = nullptr; | 62 UiElement* main_content_ = nullptr; |
| 52 UrlBar* url_bar_ = nullptr; | 63 UrlBar* url_bar_ = nullptr; |
| 53 | 64 |
| 54 bool web_vr_mode_ = false; | 65 bool in_cct_; |
| 66 bool web_vr_mode_; |
| 55 bool secure_origin_ = false; | 67 bool secure_origin_ = false; |
| 56 bool content_rendering_enabled_ = true; | 68 bool content_rendering_enabled_ = true; |
| 57 bool in_cct_; | |
| 58 | 69 |
| 59 int next_available_id_ = 1; | 70 int next_available_id_ = 1; |
| 60 | 71 |
| 61 std::vector<UiElement*> browser_ui_elements_; | 72 std::vector<UiElement*> browser_ui_elements_; |
| 62 | 73 |
| 63 base::OneShotTimer security_warning_timer_; | 74 base::OneShotTimer security_warning_timer_; |
| 64 | 75 |
| 65 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; | 76 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; |
| 66 | 77 |
| 67 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); | 78 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); |
| 68 }; | 79 }; |
| 69 | 80 |
| 70 } // namespace vr_shell | 81 } // namespace vr_shell |
| 71 | 82 |
| 72 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 83 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| OLD | NEW |