Commit efb9068d authored by Ian Vollick's avatar Ian Vollick Committed by Commit Bot

[vr] When in fullscreen, always prefer fullscreen colors.

This should take precedent over other environments, even incognito.

Bug: 853818
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I001b11ade38415e884d889c4c13c617707cfd8a7
Reviewed-on: https://chromium-review.googlesource.com/1104978Reviewed-by: default avatarChristopher Grant <cjgrant@chromium.org>
Commit-Queue: Ian Vollick <vollick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569270}
parent 06ca703c
...@@ -34,10 +34,10 @@ Model::~Model() = default; ...@@ -34,10 +34,10 @@ Model::~Model() = default;
const ColorScheme& Model::color_scheme() const { const ColorScheme& Model::color_scheme() const {
ColorScheme::Mode mode = ColorScheme::kModeNormal; ColorScheme::Mode mode = ColorScheme::kModeNormal;
if (fullscreen_enabled())
mode = ColorScheme::kModeFullscreen;
if (incognito) if (incognito)
mode = ColorScheme::kModeIncognito; mode = ColorScheme::kModeIncognito;
if (fullscreen_enabled())
mode = ColorScheme::kModeFullscreen;
return ColorScheme::GetColorScheme(mode); return ColorScheme::GetColorScheme(mode);
} }
......
...@@ -241,12 +241,12 @@ TEST_F(UiTest, UiUpdatesForIncognito) { ...@@ -241,12 +241,12 @@ TEST_F(UiTest, UiUpdatesForIncognito) {
fullscreen_background); fullscreen_background);
model_->incognito = true; model_->incognito = true;
// Make sure background has changed for incognito. // Make sure background remains fullscreen colored.
SkColor incognito_background = SK_ColorBLACK; SkColor incognito_background = SK_ColorBLACK;
GetBackgroundColor(&incognito_background); GetBackgroundColor(&incognito_background);
EXPECT_EQ( EXPECT_EQ(ColorScheme::GetColorScheme(ColorScheme::kModeFullscreen)
ColorScheme::GetColorScheme(ColorScheme::kModeIncognito).world_background, .world_background,
incognito_background); incognito_background);
model_->incognito = false; model_->incognito = false;
SkColor no_longer_incognito_background = SK_ColorBLACK; SkColor no_longer_incognito_background = SK_ColorBLACK;
...@@ -258,10 +258,13 @@ TEST_F(UiTest, UiUpdatesForIncognito) { ...@@ -258,10 +258,13 @@ TEST_F(UiTest, UiUpdatesForIncognito) {
GetBackgroundColor(&no_longer_fullscreen_background); GetBackgroundColor(&no_longer_fullscreen_background);
EXPECT_EQ(initial_background, no_longer_fullscreen_background); EXPECT_EQ(initial_background, no_longer_fullscreen_background);
// Incognito, but not fullscreen, should show incognito colors.
model_->incognito = true; model_->incognito = true;
SkColor incognito_again_background = SK_ColorBLACK; SkColor incognito_again_background = SK_ColorBLACK;
GetBackgroundColor(&incognito_again_background); GetBackgroundColor(&incognito_again_background);
EXPECT_EQ(incognito_background, incognito_again_background); EXPECT_EQ(
ColorScheme::GetColorScheme(ColorScheme::kModeIncognito).world_background,
incognito_again_background);
model_->incognito = false; model_->incognito = false;
SkColor no_longer_incognito_again_background = SK_ColorBLACK; SkColor no_longer_incognito_again_background = SK_ColorBLACK;
...@@ -1045,7 +1048,7 @@ TEST_F(UiTest, CloseButtonColorBindings) { ...@@ -1045,7 +1048,7 @@ TEST_F(UiTest, CloseButtonColorBindings) {
ui_->SetIncognito(false); ui_->SetIncognito(false);
ui_->SetFullscreen(true); ui_->SetFullscreen(true);
} }
ColorScheme scheme = ColorScheme::GetColorScheme(mode); ColorScheme scheme = model_->color_scheme();
RunForMs(kAnimationTimeMs); RunForMs(kAnimationTimeMs);
VerifyButtonColor(button, scheme.disc_button_colors.foreground, VerifyButtonColor(button, scheme.disc_button_colors.foreground,
scheme.disc_button_colors.background, "normal"); scheme.disc_button_colors.background, "normal");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment