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

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene.cc

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 #include "chrome/browser/android/vr_shell/ui_scene.h" 5 #include "chrome/browser/android/vr_shell/ui_scene.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 mode_ = mode; 181 mode_ = mode;
182 for (const auto& element : ui_elements_) 182 for (const auto& element : ui_elements_)
183 element->SetMode(mode); 183 element->SetMode(mode);
184 } 184 }
185 185
186 ColorScheme::Mode UiScene::mode() const { 186 ColorScheme::Mode UiScene::mode() const {
187 return mode_; 187 return mode_;
188 } 188 }
189 189
190 SkColor UiScene::GetWorldBackgroundColor() const { 190 SkColor UiScene::GetWorldBackgroundColor() const {
191 return ColorScheme::GetColorScheme(mode_).world_background; 191 return showing_splash_screen_
192 ? ColorScheme::GetColorScheme(mode_).splash_screen_background
193 : ColorScheme::GetColorScheme(mode_).world_background;
192 } 194 }
193 195
194 void UiScene::SetBackgroundDistance(float distance) { 196 void UiScene::SetBackgroundDistance(float distance) {
195 background_distance_ = distance; 197 background_distance_ = distance;
196 } 198 }
197 199
198 float UiScene::GetBackgroundDistance() const { 200 float UiScene::GetBackgroundDistance() const {
199 return background_distance_; 201 return background_distance_;
200 } 202 }
201 203
202 bool UiScene::GetWebVrRenderingEnabled() const { 204 bool UiScene::GetWebVrRenderingEnabled() const {
203 return webvr_rendering_enabled_; 205 return webvr_rendering_enabled_;
204 } 206 }
205 207
206 void UiScene::SetWebVrRenderingEnabled(bool enabled) { 208 void UiScene::SetWebVrRenderingEnabled(bool enabled) {
207 webvr_rendering_enabled_ = enabled; 209 webvr_rendering_enabled_ = enabled;
208 } 210 }
209 211
210 void UiScene::set_is_exiting() { 212 void UiScene::set_is_exiting() {
211 is_exiting_ = true; 213 is_exiting_ = true;
212 } 214 }
213 215
214 void UiScene::set_is_prompting_to_exit(bool prompting) { 216 void UiScene::set_is_prompting_to_exit(bool prompting) {
215 is_prompting_to_exit_ = prompting; 217 is_prompting_to_exit_ = prompting;
216 } 218 }
217 219
220 void UiScene::set_showing_splash_screen(bool showing) {
221 showing_splash_screen_ = showing;
222 }
223
218 const std::vector<std::unique_ptr<UiElement>>& UiScene::GetUiElements() const { 224 const std::vector<std::unique_ptr<UiElement>>& UiScene::GetUiElements() const {
219 return ui_elements_; 225 return ui_elements_;
220 } 226 }
221 227
222 UiScene::UiScene() = default; 228 UiScene::UiScene() = default;
223 229
224 UiScene::~UiScene() = default; 230 UiScene::~UiScene() = default;
225 231
226 void UiScene::ApplyRecursiveTransforms(UiElement* element) { 232 void UiScene::ApplyRecursiveTransforms(UiElement* element) {
227 if (!element->dirty()) 233 if (!element->dirty())
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 274
269 // TODO(mthiesse): Move this to UiSceneManager. 275 // TODO(mthiesse): Move this to UiSceneManager.
270 void UiScene::OnGLInitialized() { 276 void UiScene::OnGLInitialized() {
271 gl_initialized_ = true; 277 gl_initialized_ = true;
272 for (auto& element : ui_elements_) { 278 for (auto& element : ui_elements_) {
273 element->Initialize(); 279 element->Initialize();
274 } 280 }
275 } 281 }
276 282
277 } // namespace vr_shell 283 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene.h ('k') | chrome/browser/android/vr_shell/ui_scene_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698