Commit 350b0dae authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

BrowserThemePack: Fix GCC build after #581022

Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84849, having
base::NoDestructor<T<U>> and passing an initializer list of Us does not
work.

Just explicitly create a base::flat_set in the constructor. See also:
https://chromium-review.googlesource.com/1165360

Bug: 819294
Change-Id: I24593dc199df47c2f8fd316436517704d159e4fa
Reviewed-on: https://chromium-review.googlesource.com/1170905
Commit-Queue: Raphael Kubo da Costa (CET) <raphael.kubo.da.costa@intel.com>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582625}
parent 5743dbdd
......@@ -776,22 +776,27 @@ bool BrowserThemePack::GetTint(int id, color_utils::HSL* hsl) const {
bool BrowserThemePack::GetColor(int id, SkColor* color) const {
static const base::NoDestructor<
base::flat_set<ThemeProperties::OverwritableByUserThemeProperty>>
kOpaqueColors({
// Background tabs must be opaque since the tabstrip expects to be
// able to render text opaquely atop them.
ThemeProperties::COLOR_BACKGROUND_TAB,
ThemeProperties::COLOR_BACKGROUND_TAB_INACTIVE,
ThemeProperties::COLOR_BACKGROUND_TAB_INCOGNITO,
ThemeProperties::COLOR_BACKGROUND_TAB_INCOGNITO_INACTIVE,
// The frame colors will be used for background tabs when not
// otherwise overridden and thus must be opaque as well.
ThemeProperties::COLOR_FRAME, ThemeProperties::COLOR_FRAME_INACTIVE,
ThemeProperties::COLOR_FRAME_INCOGNITO,
ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE,
// The toolbar is used as the foreground tab color, so it must be
// opaque just like background tabs.
ThemeProperties::COLOR_TOOLBAR,
});
kOpaqueColors(
// Explicitly creating a base::flat_set here is not strictly
// necessary according to C++, but we do so to work around
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84849.
base::flat_set<ThemeProperties::OverwritableByUserThemeProperty>({
// Background tabs must be opaque since the tabstrip expects to be
// able to render text opaquely atop them.
ThemeProperties::COLOR_BACKGROUND_TAB,
ThemeProperties::COLOR_BACKGROUND_TAB_INACTIVE,
ThemeProperties::COLOR_BACKGROUND_TAB_INCOGNITO,
ThemeProperties::COLOR_BACKGROUND_TAB_INCOGNITO_INACTIVE,
// The frame colors will be used for background tabs when not
// otherwise overridden and thus must be opaque as well.
ThemeProperties::COLOR_FRAME,
ThemeProperties::COLOR_FRAME_INACTIVE,
ThemeProperties::COLOR_FRAME_INCOGNITO,
ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE,
// The toolbar is used as the foreground tab color, so it must be
// opaque just like background tabs.
ThemeProperties::COLOR_TOOLBAR,
}));
if (colors_) {
for (size_t i = 0; i < kColorTableLength; ++i) {
......
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