| 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/macros.h" | 9 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 10 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 11 #include "base/values.h" | 12 #include "base/values.h" |
| 12 #include "chrome/browser/android/vr_shell/color_scheme.h" | 13 #include "chrome/browser/android/vr_shell/color_scheme.h" |
| 13 #include "chrome/browser/android/vr_shell/ui_interface.h" | 14 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 14 #include "chrome/browser/android/vr_shell/ui_unsupported_mode.h" | 15 #include "chrome/browser/android/vr_shell/ui_unsupported_mode.h" |
| 15 #include "device/vr/vr_types.h" | 16 #include "device/vr/vr_types.h" |
| 16 | 17 |
| 17 namespace vr_shell { | 18 namespace vr_shell { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 45 void SetScreenCapturingIndicator(bool enabled); | 46 void SetScreenCapturingIndicator(bool enabled); |
| 46 void SetAudioCapturingIndicator(bool enabled); | 47 void SetAudioCapturingIndicator(bool enabled); |
| 47 | 48 |
| 48 // These methods are currently stubbed. | 49 // These methods are currently stubbed. |
| 49 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward); | 50 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward); |
| 50 | 51 |
| 51 void OnAppButtonClicked(); | 52 void OnAppButtonClicked(); |
| 52 void OnAppButtonGesturePerformed(UiInterface::Direction direction); | 53 void OnAppButtonGesturePerformed(UiInterface::Direction direction); |
| 53 | 54 |
| 54 private: | 55 private: |
| 56 FRIEND_TEST_ALL_PREFIXES(UiSceneManagerTest, UiUpdatesExitPrompt); |
| 57 |
| 55 void CreateScreenDimmer(); | 58 void CreateScreenDimmer(); |
| 56 void CreateSecurityWarnings(); | 59 void CreateSecurityWarnings(); |
| 57 void CreateSystemIndicators(); | 60 void CreateSystemIndicators(); |
| 58 void CreateContentQuad(); | 61 void CreateContentQuad(); |
| 59 void CreateBackground(); | 62 void CreateBackground(); |
| 60 void CreateUrlBar(); | 63 void CreateUrlBar(); |
| 61 void CreateCloseButton(); | 64 void CreateCloseButton(); |
| 62 void CreateExitWarning(); | |
| 63 | 65 |
| 64 void ConfigureScene(); | 66 void ConfigureScene(); |
| 65 void ConfigureSecurityWarnings(); | 67 void ConfigureSecurityWarnings(); |
| 66 void UpdateBackgroundColor(); | 68 void UpdateBackgroundColor(); |
| 67 void OnSecurityWarningTimer(); | 69 void OnSecurityWarningTimer(); |
| 68 void OnBackButtonClicked(); | 70 void OnBackButtonClicked(); |
| 71 void OnSecurityIconClicked(); |
| 72 void OnExitPromptPrimaryButtonClicked(); |
| 73 void OnExitPromptSecondaryButtonClicked(); |
| 69 void OnCloseButtonClicked(); | 74 void OnCloseButtonClicked(); |
| 70 void OnUnsupportedMode(UiUnsupportedMode mode); | 75 void OnUnsupportedMode(UiUnsupportedMode mode); |
| 71 int AllocateId(); | 76 int AllocateId(); |
| 72 ColorScheme::Mode mode() const; | 77 ColorScheme::Mode mode() const; |
| 73 const ColorScheme& color_scheme() const; | 78 const ColorScheme& color_scheme() const; |
| 74 | 79 |
| 75 UiBrowserInterface* browser_; | 80 UiBrowserInterface* browser_; |
| 76 UiScene* scene_; | 81 UiScene* scene_; |
| 77 | 82 |
| 78 // UI element pointers (not owned by the scene manager). | 83 // UI element pointers (not owned by the scene manager). |
| 79 UiElement* permanent_security_warning_ = nullptr; | 84 UiElement* permanent_security_warning_ = nullptr; |
| 80 UiElement* transient_security_warning_ = nullptr; | 85 UiElement* transient_security_warning_ = nullptr; |
| 86 UiElement* exit_prompt_ = nullptr; |
| 81 UiElement* exit_warning_ = nullptr; | 87 UiElement* exit_warning_ = nullptr; |
| 82 UiElement* main_content_ = nullptr; | 88 UiElement* main_content_ = nullptr; |
| 89 UiElement* main_content_backplane_ = nullptr; |
| 83 UiElement* audio_capture_indicator_ = nullptr; | 90 UiElement* audio_capture_indicator_ = nullptr; |
| 84 UiElement* video_capture_indicator_ = nullptr; | 91 UiElement* video_capture_indicator_ = nullptr; |
| 85 UiElement* screen_capture_indicator_ = nullptr; | 92 UiElement* screen_capture_indicator_ = nullptr; |
| 86 UiElement* screen_dimmer_ = nullptr; | 93 UiElement* screen_dimmer_ = nullptr; |
| 87 UiElement* ceiling_ = nullptr; | 94 UiElement* ceiling_ = nullptr; |
| 88 UiElement* floor_ = nullptr; | 95 UiElement* floor_ = nullptr; |
| 89 UiElement* close_button_ = nullptr; | 96 UiElement* close_button_ = nullptr; |
| 90 UrlBar* url_bar_ = nullptr; | 97 UrlBar* url_bar_ = nullptr; |
| 91 LoadingIndicator* loading_indicator_ = nullptr; | 98 LoadingIndicator* loading_indicator_ = nullptr; |
| 92 | 99 |
| 93 bool in_cct_; | 100 bool in_cct_; |
| 94 bool web_vr_mode_; | 101 bool web_vr_mode_; |
| 95 bool secure_origin_ = false; | 102 bool secure_origin_ = false; |
| 96 bool fullscreen_ = false; | 103 bool fullscreen_ = false; |
| 97 bool incognito_ = false; | 104 bool incognito_ = false; |
| 98 bool is_exiting_ = false; | |
| 99 bool audio_capturing_ = false; | 105 bool audio_capturing_ = false; |
| 100 bool video_capturing_ = false; | 106 bool video_capturing_ = false; |
| 101 bool screen_capturing_ = false; | 107 bool screen_capturing_ = false; |
| 102 | 108 |
| 103 int next_available_id_ = 1; | 109 int next_available_id_ = 1; |
| 104 | 110 |
| 105 std::vector<UiElement*> content_elements_; | 111 std::vector<UiElement*> content_elements_; |
| 112 std::vector<UiElement*> background_elements_; |
| 106 std::vector<UiElement*> control_elements_; | 113 std::vector<UiElement*> control_elements_; |
| 107 | 114 |
| 108 base::OneShotTimer security_warning_timer_; | 115 base::OneShotTimer security_warning_timer_; |
| 109 | 116 |
| 110 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; | 117 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; |
| 111 | 118 |
| 112 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); | 119 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); |
| 113 }; | 120 }; |
| 114 | 121 |
| 115 } // namespace vr_shell | 122 } // namespace vr_shell |
| 116 | 123 |
| 117 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 124 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| OLD | NEW |