Commit a9963eda authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Set tab colors in PWAs since they are used for tooltips

Bug: 1053645
Bug: 1053823
Change-Id: I8a9403a1cd4c8d8387b13c932c0772907ed636ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2064164
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Auto-Submit: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742917}
parent 17f7b260
...@@ -410,21 +410,23 @@ void AppBrowserController::UpdateThemePack() { ...@@ -410,21 +410,23 @@ void AppBrowserController::UpdateThemePack() {
// we use the theme for the frame. // we use the theme for the frame.
AutogeneratedThemeColors colors; AutogeneratedThemeColors colors;
SkColor theme_text_color = color_utils::GetColorWithMaxContrast(*theme_color); SkColor theme_text_color = color_utils::GetColorWithMaxContrast(*theme_color);
SkColor alt_color = color_utils::BlendForMinContrast(
*theme_color, *theme_color, base::nullopt,
kAutogeneratedThemeActiveTabPreferredContrast)
.color;
SkColor alt_text_color = color_utils::GetColorWithMaxContrast(alt_color);
if (has_tab_strip_) { if (has_tab_strip_) {
colors.active_tab_color = *theme_color; colors.active_tab_color = *theme_color;
colors.active_tab_text_color = theme_text_color; colors.active_tab_text_color = theme_text_color;
colors.frame_color = color_utils::BlendForMinContrast( colors.frame_color = alt_color;
*theme_color, *theme_color, base::nullopt, colors.frame_text_color = alt_text_color;
kAutogeneratedThemeActiveTabPreferredContrast)
.color;
colors.frame_text_color =
color_utils::GetColorWithMaxContrast(colors.frame_color);
} else { } else {
// Set frame and frame text only. No tab colors. // Tab colors are used for tooltips.
// TODO(crbug.com/1053823): Add tests for theme properties being set in this branch.
colors.frame_color = *theme_color; colors.frame_color = *theme_color;
colors.frame_text_color = theme_text_color; colors.frame_text_color = theme_text_color;
colors.active_tab_color = gfx::kPlaceholderColor; colors.active_tab_color = alt_color;
colors.active_tab_text_color = gfx::kPlaceholderColor; colors.active_tab_text_color = alt_text_color;
} }
BrowserThemePack::BuildFromColors(colors, theme_pack_.get()); BrowserThemePack::BuildFromColors(colors, theme_pack_.get());
} }
......
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