Commit da0c3f06 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Get autofill popup text color from the NativeTheme

R=pkasting

Change-Id: If357bc18ed07c1ec81049498920dee478a2e1bad
Bug: 914974
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063836
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742446}
parent 41abf0c4
......@@ -37,11 +37,21 @@ SkColor AutofillPopupBaseView::GetBackgroundColor() {
ui::NativeTheme::kColorId_MenuBackgroundColor);
}
SkColor AutofillPopupBaseView::GetForegroundColor() {
return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor);
}
SkColor AutofillPopupBaseView::GetSelectedBackgroundColor() {
return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor);
}
SkColor AutofillPopupBaseView::GetSelectedForegroundColor() {
return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor);
}
SkColor AutofillPopupBaseView::GetFooterBackgroundColor() {
return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_BubbleFooterBackground);
......
......@@ -37,7 +37,9 @@ class AutofillPopupBaseView : public views::WidgetDelegateView,
// Get colors used throughout various popup UIs, based on the current native
// theme.
SkColor GetBackgroundColor();
SkColor GetForegroundColor();
SkColor GetSelectedBackgroundColor();
SkColor GetSelectedForegroundColor();
SkColor GetFooterBackgroundColor();
SkColor GetSeparatorColor();
SkColor GetWarningColor();
......
......@@ -500,8 +500,12 @@ void AutofillPopupItemView::RefreshStyle() {
SetBackground(CreateBackground());
SkColor bk_color = is_selected() ? popup_view()->GetSelectedBackgroundColor()
: popup_view()->GetBackgroundColor();
SkColor fg_color = is_selected() ? popup_view()->GetSelectedForegroundColor()
: popup_view()->GetForegroundColor();
for (views::Label* label : inner_labels_) {
label->SetAutoColorReadabilityEnabled(false);
label->SetBackgroundColor(bk_color);
label->SetEnabledColor(fg_color);
}
SchedulePaint();
}
......
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