Chromium Code Reviews| 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 class UiSceneManagerTest; | |
|
amp
2017/06/05 16:44:57
I thought you didn't need to declare the test as a
ymalik
2017/06/05 20:10:33
It sure does. Thanks.
| |
| 57 FRIEND_TEST_ALL_PREFIXES(UiSceneManagerTest, UiUpdatesExitPrompt); | |
| 58 | |
| 55 void CreateScreenDimmer(); | 59 void CreateScreenDimmer(); |
| 56 void CreateSecurityWarnings(); | 60 void CreateSecurityWarnings(); |
| 57 void CreateSystemIndicators(); | 61 void CreateSystemIndicators(); |
| 58 void CreateContentQuad(); | 62 void CreateContentQuad(); |
| 59 void CreateBackground(); | 63 void CreateBackground(); |
| 60 void CreateUrlBar(); | 64 void CreateUrlBar(); |
| 61 void CreateCloseButton(); | 65 void CreateCloseButton(); |
| 62 void CreateExitWarning(); | |
| 63 | 66 |
| 64 void ConfigureScene(); | 67 void ConfigureScene(); |
| 65 void ConfigureSecurityWarnings(); | 68 void ConfigureSecurityWarnings(); |
| 66 void UpdateBackgroundColor(); | 69 void UpdateBackgroundColor(); |
| 67 void OnSecurityWarningTimer(); | 70 void OnSecurityWarningTimer(); |
| 68 void OnBackButtonClicked(); | 71 void OnBackButtonClicked(); |
| 72 void OnSecurityIconClicked(); | |
| 73 void OnExitPromptPrimaryButtonClicked(); | |
| 74 void OnExitPromptSecondaryButtonClicked(); | |
| 69 void OnCloseButtonClicked(); | 75 void OnCloseButtonClicked(); |
| 70 void OnUnsupportedMode(UiUnsupportedMode mode); | 76 void OnUnsupportedMode(UiUnsupportedMode mode); |
| 71 int AllocateId(); | 77 int AllocateId(); |
| 72 ColorScheme::Mode mode() const; | 78 ColorScheme::Mode mode() const; |
| 73 const ColorScheme& color_scheme() const; | 79 const ColorScheme& color_scheme() const; |
| 74 | 80 |
| 75 VrBrowserInterface* browser_; | 81 VrBrowserInterface* browser_; |
| 76 UiScene* scene_; | 82 UiScene* scene_; |
| 77 | 83 |
| 78 // UI element pointers (not owned by the scene manager). | 84 // UI element pointers (not owned by the scene manager). |
| 79 UiElement* permanent_security_warning_ = nullptr; | 85 UiElement* permanent_security_warning_ = nullptr; |
| 80 UiElement* transient_security_warning_ = nullptr; | 86 UiElement* transient_security_warning_ = nullptr; |
| 87 UiElement* exit_prompt_ = nullptr; | |
| 81 UiElement* exit_warning_ = nullptr; | 88 UiElement* exit_warning_ = nullptr; |
| 82 UiElement* main_content_ = nullptr; | 89 UiElement* main_content_ = nullptr; |
| 90 UiElement* main_content_backplane_ = nullptr; | |
| 83 UiElement* audio_capture_indicator_ = nullptr; | 91 UiElement* audio_capture_indicator_ = nullptr; |
| 84 UiElement* video_capture_indicator_ = nullptr; | 92 UiElement* video_capture_indicator_ = nullptr; |
| 85 UiElement* screen_capture_indicator_ = nullptr; | 93 UiElement* screen_capture_indicator_ = nullptr; |
| 86 UiElement* screen_dimmer_ = nullptr; | 94 UiElement* screen_dimmer_ = nullptr; |
| 87 UiElement* ceiling_ = nullptr; | 95 UiElement* ceiling_ = nullptr; |
| 88 UiElement* floor_ = nullptr; | 96 UiElement* floor_ = nullptr; |
| 89 UrlBar* url_bar_ = nullptr; | 97 UrlBar* url_bar_ = nullptr; |
| 90 LoadingIndicator* loading_indicator_ = nullptr; | 98 LoadingIndicator* loading_indicator_ = nullptr; |
| 91 | 99 |
| 92 bool in_cct_; | 100 bool in_cct_; |
| 93 bool web_vr_mode_; | 101 bool web_vr_mode_; |
| 94 bool secure_origin_ = false; | 102 bool secure_origin_ = false; |
| 95 bool fullscreen_ = false; | 103 bool fullscreen_ = false; |
| 96 bool incognito_ = false; | 104 bool incognito_ = false; |
| 97 bool is_exiting_ = false; | |
| 98 bool audio_capturing_ = false; | 105 bool audio_capturing_ = false; |
| 99 bool video_capturing_ = false; | 106 bool video_capturing_ = false; |
| 100 bool screen_capturing_ = false; | 107 bool screen_capturing_ = false; |
| 101 | 108 |
| 102 int next_available_id_ = 1; | 109 int next_available_id_ = 1; |
| 103 | 110 |
| 104 std::vector<UiElement*> content_elements_; | 111 std::vector<UiElement*> content_elements_; |
| 112 std::vector<UiElement*> background_elements_; | |
| 105 std::vector<UiElement*> control_elements_; | 113 std::vector<UiElement*> control_elements_; |
| 106 | 114 |
| 107 base::OneShotTimer security_warning_timer_; | 115 base::OneShotTimer security_warning_timer_; |
| 108 | 116 |
| 109 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; | 117 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; |
| 110 | 118 |
| 111 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); | 119 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); |
| 112 }; | 120 }; |
| 113 | 121 |
| 114 } // namespace vr_shell | 122 } // namespace vr_shell |
| 115 | 123 |
| 116 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 124 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| OLD | NEW |