Chromium Code Reviews| Index: chrome/browser/android/vr_shell/ui_scene_manager.cc |
| diff --git a/chrome/browser/android/vr_shell/ui_scene_manager.cc b/chrome/browser/android/vr_shell/ui_scene_manager.cc |
| index 8a242b10596804c6611a75cf0964037e03a63ce7..01f7703122dcc17e4df76521b7ebc833c3bf467f 100644 |
| --- a/chrome/browser/android/vr_shell/ui_scene_manager.cc |
| +++ b/chrome/browser/android/vr_shell/ui_scene_manager.cc |
| @@ -6,7 +6,6 @@ |
| #include "base/callback.h" |
| #include "base/memory/ptr_util.h" |
| -#include "chrome/browser/android/vr_shell/color_scheme.h" |
| #include "chrome/browser/android/vr_shell/textures/close_button_texture.h" |
| #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| #include "chrome/browser/android/vr_shell/ui_elements/audio_capture_indicator.h" |
| @@ -255,7 +254,6 @@ void UiSceneManager::CreateBackground() { |
| element = base::MakeUnique<UiElement>(); |
| element->set_debug_id(kFloorGrid); |
| element->set_id(AllocateId()); |
| - element->set_fill(vr_shell::Fill::GRID_GRADIENT); |
| element->set_size({kSceneSize, kSceneSize, 1.0}); |
| element->set_translation({0.0, -kSceneHeight / 2 + kTextureOffset, 0.0}); |
| element->set_rotation({1.0, 0.0, 0.0, -M_PI / 2}); |
| @@ -352,13 +350,15 @@ void UiSceneManager::ConfigureScene() { |
| main_content_->set_size({kContentWidth, kContentHeight, 1}); |
| } |
| - UpdateBackgroundColor(); |
| + scene_->SetMode(mode()); |
| scene_->SetBackgroundDistance(main_content_->translation().z() * |
| -kBackgroundDistanceMultiplier); |
| + UpdateBackgroundColor(); |
| } |
| void UiSceneManager::UpdateBackgroundColor() { |
| - scene_->SetBackgroundColor(color_scheme().horizon); |
| + // TODO(vollick): it would be nice if ceiling, floor and the grid were |
| + // UiElement subclasses and could respond to the OnSetMode signal. |
| ceiling_->set_center_color(color_scheme().ceiling); |
| ceiling_->set_edge_color(color_scheme().horizon); |
| floor_->set_center_color(color_scheme().floor); |
| @@ -366,6 +366,7 @@ void UiSceneManager::UpdateBackgroundColor() { |
| floor_grid_->set_center_color(color_scheme().floor_grid); |
| SkColor floor_grid_edge_color = SkColorSetA(color_scheme().floor_grid, 0); |
| floor_grid_->set_edge_color(floor_grid_edge_color); |
| + floor_grid_->set_center_color(color_scheme().horizon); |
|
amp
2017/05/27 00:47:47
wait, why are we setting this to horizon? We just
Ian Vollick
2017/05/27 01:29:12
Whoops. Fixed.
|
| } |
| void UiSceneManager::SetAudioCapturingIndicator(bool enabled) { |
| @@ -388,6 +389,13 @@ void UiSceneManager::SetWebVrSecureOrigin(bool secure) { |
| ConfigureSecurityWarnings(); |
| } |
| +void UiSceneManager::SetIncognito(bool incognito) { |
| + if (incognito == incognito_) |
| + return; |
| + incognito_ = incognito; |
| + ConfigureScene(); |
| +} |
| + |
| void UiSceneManager::OnAppButtonClicked() { |
| // App button click exits the WebVR presentation and fullscreen. |
| browser_->ExitPresent(); |
| @@ -459,9 +467,16 @@ int UiSceneManager::AllocateId() { |
| return next_available_id_++; |
| } |
| +ColorScheme::Mode UiSceneManager::mode() const { |
| + if (incognito_) |
| + return ColorScheme::kModeIncognito; |
| + if (fullscreen_) |
| + return ColorScheme::kModeFullscreen; |
| + return ColorScheme::kModeNormal; |
| +} |
| + |
| const ColorScheme& UiSceneManager::color_scheme() const { |
| - return ColorScheme::GetColorScheme(fullscreen_ ? ColorScheme::kModeFullscreen |
| - : ColorScheme::kModeNormal); |
| + return ColorScheme::GetColorScheme(mode()); |
| } |
| } // namespace vr_shell |