Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene_manager.h

Issue 2955483003: Show splash screen when entering VR from a deep-link (Closed)
Patch Set: fix compile error on bots Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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, bool show_toast); 43 void SetWebVrMode(bool web_vr, bool show_toast);
42 void SetSecurityInfo(security_state::SecurityLevel level, bool malware); 44 void SetSecurityInfo(security_state::SecurityLevel level, bool malware);
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);
49 void SetLocationAccessIndicator(bool enabled); 51 void SetLocationAccessIndicator(bool enabled);
52 void SetSplashScreenIcon(const SkBitmap& bitmap);
50 53
51 // These methods are currently stubbed. 54 // These methods are currently stubbed.
52 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward); 55 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward);
53 56
54 void OnGLInitialized(); 57 void OnGLInitialized();
55 void OnAppButtonClicked(); 58 void OnAppButtonClicked();
56 void OnAppButtonGesturePerformed(UiInterface::Direction direction); 59 void OnAppButtonGesturePerformed(UiInterface::Direction direction);
57 60
58 void OnSecurityIconClickedForTesting(); 61 void OnSecurityIconClickedForTesting();
59 void OnExitPromptPrimaryButtonClickedForTesting(); 62 void OnExitPromptPrimaryButtonClickedForTesting();
60 63
61 private: 64 private:
62 enum ToastState { 65 enum ToastState {
63 UNCHANGED = 0, 66 UNCHANGED = 0,
64 SET_FOR_WEB_VR, 67 SET_FOR_WEB_VR,
65 SET_FOR_FULLSCREEN, 68 SET_FOR_FULLSCREEN,
66 }; 69 };
67 void CreateScreenDimmer(); 70 void CreateScreenDimmer();
68 void CreateSecurityWarnings(); 71 void CreateSecurityWarnings();
69 void CreateSystemIndicators(); 72 void CreateSystemIndicators();
70 void CreateContentQuad(); 73 void CreateContentQuad();
74 void CreateSplashScreen();
71 void CreateBackground(); 75 void CreateBackground();
72 void CreateUrlBar(); 76 void CreateUrlBar();
73 void CreateTransientUrlBar(); 77 void CreateTransientUrlBar();
74 void CreateCloseButton(); 78 void CreateCloseButton();
75 void CreateExitPrompt(); 79 void CreateExitPrompt();
76 void CreateToasts(); 80 void CreateToasts();
77 81
78 void ConfigureScene(); 82 void ConfigureScene();
79 void ConfigureSecurityWarnings(); 83 void ConfigureSecurityWarnings();
80 void ConfigureTransientUrlBar(); 84 void ConfigureTransientUrlBar();
(...skipping 27 matching lines...) Expand all
108 UiElement* exit_warning_ = nullptr; 112 UiElement* exit_warning_ = nullptr;
109 UiElement* main_content_ = nullptr; 113 UiElement* main_content_ = nullptr;
110 UiElement* audio_capture_indicator_ = nullptr; 114 UiElement* audio_capture_indicator_ = nullptr;
111 UiElement* video_capture_indicator_ = nullptr; 115 UiElement* video_capture_indicator_ = nullptr;
112 UiElement* screen_capture_indicator_ = nullptr; 116 UiElement* screen_capture_indicator_ = nullptr;
113 UiElement* location_access_indicator_ = nullptr; 117 UiElement* location_access_indicator_ = nullptr;
114 UiElement* screen_dimmer_ = nullptr; 118 UiElement* screen_dimmer_ = nullptr;
115 UiElement* ceiling_ = nullptr; 119 UiElement* ceiling_ = nullptr;
116 UiElement* floor_ = nullptr; 120 UiElement* floor_ = nullptr;
117 UiElement* close_button_ = nullptr; 121 UiElement* close_button_ = nullptr;
122 SplashScreenIcon* splash_screen_icon_ = nullptr;
118 UrlBar* url_bar_ = nullptr; 123 UrlBar* url_bar_ = nullptr;
119 TransientUrlBar* transient_url_bar_ = nullptr; 124 TransientUrlBar* transient_url_bar_ = nullptr;
120 LoadingIndicator* loading_indicator_ = nullptr; 125 LoadingIndicator* loading_indicator_ = nullptr;
121 126
122 std::vector<UiElement*> system_indicators_; 127 std::vector<UiElement*> system_indicators_;
123 128
124 bool in_cct_; 129 bool in_cct_;
125 bool web_vr_mode_; 130 bool web_vr_mode_;
126 bool web_vr_autopresented_ = false;
127 bool web_vr_show_toast_ = false; 131 bool web_vr_show_toast_ = false;
132 bool web_vr_autopresentation_expected_ = false;
128 bool secure_origin_ = false; 133 bool secure_origin_ = false;
129 bool fullscreen_ = false; 134 bool fullscreen_ = false;
130 bool incognito_ = false; 135 bool incognito_ = false;
131 bool audio_capturing_ = false; 136 bool audio_capturing_ = false;
132 bool video_capturing_ = false; 137 bool video_capturing_ = false;
133 bool screen_capturing_ = false; 138 bool screen_capturing_ = false;
134 bool location_access_ = false; 139 bool location_access_ = false;
135 ToastState toast_state_ = UNCHANGED; 140 ToastState toast_state_ = UNCHANGED;
136 141
137 int next_available_id_ = 1; 142 int next_available_id_ = 1;
138 143
139 std::vector<UiElement*> content_elements_; 144 std::vector<UiElement*> content_elements_;
140 std::vector<UiElement*> background_elements_; 145 std::vector<UiElement*> background_elements_;
141 std::vector<UiElement*> control_elements_; 146 std::vector<UiElement*> control_elements_;
142 147
143 base::OneShotTimer security_warning_timer_; 148 base::OneShotTimer security_warning_timer_;
144 base::OneShotTimer transient_url_bar_timer_; 149 base::OneShotTimer transient_url_bar_timer_;
145 base::OneShotTimer presentation_toast_timer_; 150 base::OneShotTimer presentation_toast_timer_;
146 151
147 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; 152 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_;
148 153
149 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); 154 DISALLOW_COPY_AND_ASSIGN(UiSceneManager);
150 }; 155 };
151 156
152 } // namespace vr_shell 157 } // namespace vr_shell
153 158
154 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ 159 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene.cc ('k') | chrome/browser/android/vr_shell/ui_scene_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698