Commit 3e5002e9 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Copy the incognito background tab text color from the regular tab text color.

This preserves the "theme both normal and incognito windows" behavior of
COLOR_BACKGROUND_TAB_TEXT, which was the only color available until I added
incognito and inactive variants last week.  It makes some themes look more like
their authors intended (e.g. Black Red Shards).  OTOH, it makes some themes
unreadable because the copied text color doesn't work in the current treatment
of incognito tabs.  I'm not sure which route is better, but this route seems to
at least err on the side of author intent, so...

Bug: 869395
Test: Install "Black Red Shards" theme, open an incognito window with multiple tabs, check that text is red on all tabs.
Change-Id: Idef3b07edd2b49b1acc440edaf8c31838350dd98
Reviewed-on: https://chromium-review.googlesource.com/1157867Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579845}
parent ba1e993b
......@@ -51,7 +51,7 @@ constexpr int kTallestTabHeight = 41;
// theme packs that aren't int-equal to this. Increment this number if you
// change default theme assets or if you need themes to recreate their generated
// images (which are cached).
const int kThemePackVersion = 52;
const int kThemePackVersion = 53;
// IDs that are in the DataPack won't clash with the positive integer
// uint16_t. kHeaderID should always have the maximum value because we want the
......@@ -955,10 +955,12 @@ void BrowserThemePack::BuildColorsFromJSON(
// Generate inactive background tab text colors if active colors were
// specified.
static constexpr int kColorsToCopy[][2] = {
{ThemeProperties::COLOR_BACKGROUND_TAB_TEXT,
ThemeProperties::COLOR_BACKGROUND_TAB_TEXT_INACTIVE},
{ThemeProperties::COLOR_BACKGROUND_TAB_TEXT_INCOGNITO,
ThemeProperties::COLOR_BACKGROUND_TAB_TEXT_INCOGNITO_INACTIVE},
{ThemeProperties::COLOR_BACKGROUND_TAB_TEXT,
ThemeProperties::COLOR_BACKGROUND_TAB_TEXT_INACTIVE},
{ThemeProperties::COLOR_BACKGROUND_TAB_TEXT,
ThemeProperties::COLOR_BACKGROUND_TAB_TEXT_INCOGNITO},
{ThemeProperties::COLOR_BACKGROUND_TAB_TEXT_INCOGNITO,
ThemeProperties::COLOR_BACKGROUND_TAB_TEXT_INCOGNITO_INACTIVE},
};
for (const int* text_colors : kColorsToCopy) {
const auto src_it = temp_colors.find(text_colors[0]);
......
......@@ -488,6 +488,10 @@ TEST_F(BrowserThemePackTest, SupportsAlpha) {
colors[TP::COLOR_BACKGROUND_TAB_TEXT] = SkColorSetARGB(0, 120, 140, 160);
colors[TP::COLOR_BACKGROUND_TAB_TEXT_INACTIVE] =
colors[TP::COLOR_BACKGROUND_TAB_TEXT];
colors[TP::COLOR_BACKGROUND_TAB_TEXT_INCOGNITO] =
colors[TP::COLOR_BACKGROUND_TAB_TEXT];
colors[TP::COLOR_BACKGROUND_TAB_TEXT_INCOGNITO_INACTIVE] =
colors[TP::COLOR_BACKGROUND_TAB_TEXT_INCOGNITO];
colors[TP::COLOR_BOOKMARK_TEXT] = SkColorSetARGB(255, 180, 200, 220);
colors[TP::COLOR_NTP_TEXT] = SkColorSetARGB(128, 240, 255, 0);
VerifyColorMap(colors);
......
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