Commit 42969f1f authored by Connie Wan's avatar Connie Wan Committed by Commit Bot

Color tab group editor bubble icons based on native theme

Previously it was being colored dark/light based on the browser theme, which made the color the same as the actual group in the tab strip. But bubbles are not affected by browser themes, but rather by native themes, similar to context menus.

See attached bugs for full context.

Bug: 1027483, 1039998
Change-Id: Id783f71e643b720f3c138e736db25d69a92d122b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992310Reviewed-by: default avatarCharlene Yan <cyan@chromium.org>
Commit-Queue: Connie Wan <connily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729554}
parent 5bd3bd2b
......@@ -29,6 +29,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/label.h"
......@@ -170,12 +171,15 @@ TabGroupEditorBubbleView::~TabGroupEditorBubbleView() = default;
void TabGroupEditorBubbleView::InitColorSet() {
base::flat_map<tab_groups::TabGroupColorId, tab_groups::TabGroupColor>
all_colors = tab_groups::GetTabGroupColorSet();
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
color_ids_.reserve(all_colors.size());
colors_.reserve(all_colors.size());
for (auto const color_pair : all_colors) {
color_ids_.push_back(color_pair.first);
SkColor color = tab_controller_->GetPaintedGroupColor(color_pair.first);
SkColor color = native_theme->ShouldUseDarkColors()
? color_pair.second.dark_theme_color
: color_pair.second.light_theme_color;
colors_.push_back({color, color_pair.second.label});
}
}
......
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