Commit cd5ddf6c authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Chromium LUCI CQ

Revert "[Controls Refresh] Bug fix for Datalist uses wrong colors for HC black"

This reverts commit 1935a9b5.

Reason for revert: Strongly suspected cause of crbug.com/1167118

Original change's description:
> [Controls Refresh] Bug fix for Datalist uses wrong colors for HC black
> and HC white
>
> This CL fixes an issue in which, when in ForcedColors mode, the data
> list control uses an the default color scheme
>
> Bug: 1157185
> Change-Id: I5103d371fe69226be4ee495f237dd23c874f23f7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2623150
> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> Commit-Queue: Sam Sebree <sasebree@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#842778}

TBR=ellyjones@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,sasebree@microsoft.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1157185
Change-Id: I67167385980f3dca8a35e0b72f3ed6b00bc7d647
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643459Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845824}
parent 9c8466cd
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "ui/accessibility/platform/ax_platform_node.h" #include "ui/accessibility/platform/ax_platform_node.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/color_palette.h" #include "ui/gfx/color_palette.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/accessibility/view_accessibility.h" #include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/border.h" #include "ui/views/border.h"
#include "ui/views/bubble/bubble_border.h" #include "ui/views/bubble/bubble_border.h"
...@@ -38,37 +39,23 @@ int AutofillPopupBaseView::GetCornerRadius() { ...@@ -38,37 +39,23 @@ int AutofillPopupBaseView::GetCornerRadius() {
} }
SkColor AutofillPopupBaseView::GetBackgroundColor() { SkColor AutofillPopupBaseView::GetBackgroundColor() {
return GetHighContrastAwareColor( return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_DropdownBackgroundColor, ui::NativeTheme::kColorId_DropdownBackgroundColor);
ui::NativeTheme::SystemThemeColor::kButtonFace);
} }
SkColor AutofillPopupBaseView::GetForegroundColor() { SkColor AutofillPopupBaseView::GetForegroundColor() {
return GetHighContrastAwareColor( return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_DropdownForegroundColor, ui::NativeTheme::kColorId_DropdownForegroundColor);
ui::NativeTheme::SystemThemeColor::kButtonText);
} }
SkColor AutofillPopupBaseView::GetSelectedBackgroundColor() { SkColor AutofillPopupBaseView::GetSelectedBackgroundColor() {
return GetHighContrastAwareColor( return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_DropdownSelectedBackgroundColor, ui::NativeTheme::kColorId_DropdownSelectedBackgroundColor);
ui::NativeTheme::SystemThemeColor::kButtonText);
} }
SkColor AutofillPopupBaseView::GetSelectedForegroundColor() { SkColor AutofillPopupBaseView::GetSelectedForegroundColor() {
return GetHighContrastAwareColor( return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_DropdownSelectedForegroundColor, ui::NativeTheme::kColorId_DropdownSelectedForegroundColor);
ui::NativeTheme::SystemThemeColor::kButtonFace);
}
SkColor AutofillPopupBaseView::GetHighContrastAwareColor(
ui::NativeTheme::ColorId non_hc_color,
ui::NativeTheme::SystemThemeColor hc_color) {
if (ui::NativeTheme::GetInstanceForWeb()->UserHasContrastPreference()) {
return *GetNativeTheme()->GetSystemThemeColor(hc_color);
} else {
return GetNativeTheme()->GetSystemColor(non_hc_color);
}
} }
SkColor AutofillPopupBaseView::GetFooterBackgroundColor() { SkColor AutofillPopupBaseView::GetFooterBackgroundColor() {
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/focus/widget_focus_manager.h" #include "ui/views/focus/widget_focus_manager.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_delegate.h"
...@@ -49,8 +48,6 @@ class AutofillPopupBaseView : public views::WidgetDelegateView, ...@@ -49,8 +48,6 @@ class AutofillPopupBaseView : public views::WidgetDelegateView,
SkColor GetForegroundColor(); SkColor GetForegroundColor();
SkColor GetSelectedBackgroundColor(); SkColor GetSelectedBackgroundColor();
SkColor GetSelectedForegroundColor(); SkColor GetSelectedForegroundColor();
SkColor GetHighContrastAwareColor(ui::NativeTheme::ColorId non_hc_color,
ui::NativeTheme::SystemThemeColor hc_color);
SkColor GetFooterBackgroundColor(); SkColor GetFooterBackgroundColor();
SkColor GetSeparatorColor(); SkColor GetSeparatorColor();
SkColor GetWarningColor(); SkColor GetWarningColor();
......
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