| 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/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/android/vr_shell/color_scheme.h" | 13 #include "chrome/browser/android/vr_shell/color_scheme.h" |
| 14 #include "chrome/browser/android/vr_shell/ui_interface.h" | 14 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 15 #include "chrome/browser/android/vr_shell/ui_unsupported_mode.h" | 15 #include "chrome/browser/android/vr_shell/ui_unsupported_mode.h" |
| 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 16 | 17 |
| 17 namespace vr_shell { | 18 namespace vr_shell { |
| 18 | 19 |
| 19 class LoadingIndicator; | 20 class LoadingIndicator; |
| 21 class SplashScreenIcon; |
| 20 class TransientUrlBar; | 22 class TransientUrlBar; |
| 21 class UiBrowserInterface; | 23 class UiBrowserInterface; |
| 22 class UiElement; | 24 class UiElement; |
| 23 class UiScene; | 25 class UiScene; |
| 24 class UrlBar; | 26 class UrlBar; |
| 25 | 27 |
| 26 class UiSceneManager { | 28 class UiSceneManager { |
| 27 public: | 29 public: |
| 28 UiSceneManager(UiBrowserInterface* browser, | 30 UiSceneManager(UiBrowserInterface* browser, |
| 29 UiScene* scene, | 31 UiScene* scene, |
| 30 bool in_cct, | 32 bool in_cct, |
| 31 bool in_web_vr, | 33 bool in_web_vr, |
| 32 bool web_vr_autopresented); | 34 bool web_vr_autopresentation_expected); |
| 33 ~UiSceneManager(); | 35 ~UiSceneManager(); |
| 34 | 36 |
| 35 base::WeakPtr<UiSceneManager> GetWeakPtr(); | 37 base::WeakPtr<UiSceneManager> GetWeakPtr(); |
| 36 | 38 |
| 37 void SetFullscreen(bool fullscreen); | 39 void SetFullscreen(bool fullscreen); |
| 38 void SetIncognito(bool incognito); | 40 void SetIncognito(bool incognito); |
| 39 void SetURL(const GURL& gurl); | 41 void SetURL(const GURL& gurl); |
| 40 void SetWebVrSecureOrigin(bool secure); | 42 void SetWebVrSecureOrigin(bool secure); |
| 41 void SetWebVrMode(bool web_vr, bool auto_presented); | 43 void SetWebVrMode(bool web_vr); |
| 42 void SetSecurityLevel(security_state::SecurityLevel level); | 44 void SetSecurityLevel(security_state::SecurityLevel level); |
| 43 void SetLoading(bool loading); | 45 void SetLoading(bool loading); |
| 44 void SetLoadProgress(float progress); | 46 void SetLoadProgress(float progress); |
| 45 void SetIsExiting(); | 47 void SetIsExiting(); |
| 46 void SetVideoCapturingIndicator(bool enabled); | 48 void SetVideoCapturingIndicator(bool enabled); |
| 47 void SetScreenCapturingIndicator(bool enabled); | 49 void SetScreenCapturingIndicator(bool enabled); |
| 48 void SetAudioCapturingIndicator(bool enabled); | 50 void SetAudioCapturingIndicator(bool enabled); |
| 51 void SetSplashScreenIcon(const SkBitmap& bitmap); |
| 49 | 52 |
| 50 // These methods are currently stubbed. | 53 // These methods are currently stubbed. |
| 51 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward); | 54 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward); |
| 52 | 55 |
| 53 void OnAppButtonClicked(); | 56 void OnAppButtonClicked(); |
| 54 void OnAppButtonGesturePerformed(UiInterface::Direction direction); | 57 void OnAppButtonGesturePerformed(UiInterface::Direction direction); |
| 55 | 58 |
| 56 void OnSecurityIconClickedForTesting(); | 59 void OnSecurityIconClickedForTesting(); |
| 57 void OnExitPromptPrimaryButtonClickedForTesting(); | 60 void OnExitPromptPrimaryButtonClickedForTesting(); |
| 58 | 61 |
| 59 private: | 62 private: |
| 60 void CreateScreenDimmer(); | 63 void CreateScreenDimmer(); |
| 61 void CreateSecurityWarnings(); | 64 void CreateSecurityWarnings(); |
| 62 void CreateSystemIndicators(); | 65 void CreateSystemIndicators(); |
| 63 void CreateContentQuad(); | 66 void CreateContentQuad(); |
| 67 void CreateSplashScreen(); |
| 64 void CreateBackground(); | 68 void CreateBackground(); |
| 65 void CreateUrlBar(); | 69 void CreateUrlBar(); |
| 66 void CreateTransientUrlBar(); | 70 void CreateTransientUrlBar(); |
| 67 void CreateCloseButton(); | 71 void CreateCloseButton(); |
| 68 void CreateExitPrompt(); | 72 void CreateExitPrompt(); |
| 69 | 73 |
| 70 void ConfigureScene(); | 74 void ConfigureScene(); |
| 71 void ConfigureSecurityWarnings(); | 75 void ConfigureSecurityWarnings(); |
| 72 void ConfigureTransientUrlBar(); | 76 void ConfigureTransientUrlBar(); |
| 73 void UpdateBackgroundColor(); | 77 void UpdateBackgroundColor(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 95 UiElement* exit_prompt_backplane_ = nullptr; | 99 UiElement* exit_prompt_backplane_ = nullptr; |
| 96 UiElement* exit_warning_ = nullptr; | 100 UiElement* exit_warning_ = nullptr; |
| 97 UiElement* main_content_ = nullptr; | 101 UiElement* main_content_ = nullptr; |
| 98 UiElement* audio_capture_indicator_ = nullptr; | 102 UiElement* audio_capture_indicator_ = nullptr; |
| 99 UiElement* video_capture_indicator_ = nullptr; | 103 UiElement* video_capture_indicator_ = nullptr; |
| 100 UiElement* screen_capture_indicator_ = nullptr; | 104 UiElement* screen_capture_indicator_ = nullptr; |
| 101 UiElement* screen_dimmer_ = nullptr; | 105 UiElement* screen_dimmer_ = nullptr; |
| 102 UiElement* ceiling_ = nullptr; | 106 UiElement* ceiling_ = nullptr; |
| 103 UiElement* floor_ = nullptr; | 107 UiElement* floor_ = nullptr; |
| 104 UiElement* close_button_ = nullptr; | 108 UiElement* close_button_ = nullptr; |
| 109 SplashScreenIcon* splash_screen_icon_ = nullptr; |
| 105 UrlBar* url_bar_ = nullptr; | 110 UrlBar* url_bar_ = nullptr; |
| 106 TransientUrlBar* transient_url_bar_ = nullptr; | 111 TransientUrlBar* transient_url_bar_ = nullptr; |
| 107 LoadingIndicator* loading_indicator_ = nullptr; | 112 LoadingIndicator* loading_indicator_ = nullptr; |
| 108 | 113 |
| 109 bool in_cct_; | 114 bool in_cct_; |
| 110 bool web_vr_mode_; | 115 bool web_vr_mode_; |
| 111 bool web_vr_autopresented_ = false; | 116 bool web_vr_autopresentation_expected_ = false; |
| 112 bool secure_origin_ = false; | 117 bool secure_origin_ = false; |
| 113 bool fullscreen_ = false; | 118 bool fullscreen_ = false; |
| 114 bool incognito_ = false; | 119 bool incognito_ = false; |
| 115 bool audio_capturing_ = false; | 120 bool audio_capturing_ = false; |
| 116 bool video_capturing_ = false; | 121 bool video_capturing_ = false; |
| 117 bool screen_capturing_ = false; | 122 bool screen_capturing_ = false; |
| 118 | 123 |
| 119 int next_available_id_ = 1; | 124 int next_available_id_ = 1; |
| 120 | 125 |
| 121 std::vector<UiElement*> content_elements_; | 126 std::vector<UiElement*> content_elements_; |
| 122 std::vector<UiElement*> background_elements_; | 127 std::vector<UiElement*> background_elements_; |
| 123 std::vector<UiElement*> control_elements_; | 128 std::vector<UiElement*> control_elements_; |
| 124 | 129 |
| 125 base::OneShotTimer security_warning_timer_; | 130 base::OneShotTimer security_warning_timer_; |
| 126 base::OneShotTimer transient_url_bar_timer_; | 131 base::OneShotTimer transient_url_bar_timer_; |
| 127 | 132 |
| 128 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; | 133 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; |
| 129 | 134 |
| 130 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); | 135 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); |
| 131 }; | 136 }; |
| 132 | 137 |
| 133 } // namespace vr_shell | 138 } // namespace vr_shell |
| 134 | 139 |
| 135 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 140 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| OLD | NEW |