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

Unified Diff: chrome/browser/android/vr_shell/ui_scene_manager.cc

Issue 2902043005: [vr] Add incognito coloring (Closed)
Patch Set: rebase Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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 4845c90f9e9e21022f1f2de5301cdf72c04b6c76..675506839e7b4dec6426f7ae540cdf9028e9dd66 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager.cc
@@ -255,12 +255,12 @@ 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});
element->set_fill(vr_shell::Fill::GRID_GRADIENT);
element->set_gridline_count(kFloorGridlineCount);
+ element->set_center_color(color_scheme().horizon);
amp 2017/05/26 17:48:20 Aren't all the colors for the background being han
Ian Vollick 2017/05/27 00:30:18 Done.
element->set_draw_phase(0);
floor_grid_ = element.get();
content_elements_.push_back(element.get());
@@ -383,6 +383,14 @@ void UiSceneManager::SetWebVrSecureOrigin(bool secure) {
ConfigureSecurityWarnings();
}
+void UiSceneManager::SetIncognito(bool incognito) {
+ const bool needs_update = incognito != incognito_;
+ incognito_ = incognito;
+ if (needs_update)
+ UpdateBackgroundColor();
+ url_bar_->SetIncognito(incognito);
+}
+
void UiSceneManager::OnAppButtonClicked() {
// App button click exits the WebVR presentation and fullscreen.
browser_->ExitPresent();
@@ -455,8 +463,11 @@ int UiSceneManager::AllocateId() {
}
const ColorScheme& UiSceneManager::color_scheme() const {
- return ColorScheme::GetColorScheme(fullscreen_ ? ColorScheme::kModeFullscreen
- : ColorScheme::kModeNormal);
+ if (incognito_)
+ return ColorScheme::GetColorScheme(ColorScheme::kModeIncognito);
+ if (fullscreen_)
+ return ColorScheme::GetColorScheme(ColorScheme::kModeFullscreen);
+ return ColorScheme::GetColorScheme(ColorScheme::kModeNormal);
}
} // namespace vr_shell

Powered by Google App Engine
This is Rietveld 408576698