From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Mon, 14 Feb 2022 19:24:36 +0900
Subject: Port autofill colors to the color pipeline.

https://chromium-review.googlesource.com/c/chromium/src/+/1652925 removed colors as they are no longer
needed in chromium but our autofill implementation uses them.  This patch can be removed if we refactor
our autofill implementation to work like Chromium's.

diff --git a/ui/color/color_id.h b/ui/color/color_id.h
index 0a9045ddd0c02064ce2557cc8ff8c893713e1d80..eaa24c5e32bc1080481acb84be6df1515ee57915 100644
--- a/ui/color/color_id.h
+++ b/ui/color/color_id.h
@@ -373,6 +373,10 @@
   E_CPONLY(kColorScrollbarThumbInactive) \
   E_CPONLY(kColorScrollbarThumbPressed) \
   E_CPONLY(kColorScrollbarTrack) \
+  E_CPONLY(kColorResultsTableNormalBackground) \
+  E_CPONLY(kColorResultsTableHoveredBackground) \
+  E_CPONLY(kColorResultsTableNormalText) \
+  E_CPONLY(kColorResultsTableDimmedText) \
   E_CPONLY(kColorSegmentedButtonBorder) \
   E_CPONLY(kColorSegmentedButtonFocus) \
   E_CPONLY(kColorSegmentedButtonForegroundChecked) \
@@ -460,6 +464,7 @@
   E_CPONLY(kColorTreeNodeForeground) \
   E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \
   E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \
+  E_CPONLY(kColorUnfocusedBorder) \
   E_CPONLY(kColorWindowBackground)
 
 #if BUILDFLAG(IS_CHROMEOS)
diff --git a/ui/color/ui_color_mixer.cc b/ui/color/ui_color_mixer.cc
index 5f73cfc2dc8b80eb82e7793dee538cb6d03364bf..8378aa22e901e1f128cd9930aef6779bab979741 100644
--- a/ui/color/ui_color_mixer.cc
+++ b/ui/color/ui_color_mixer.cc
@@ -224,6 +224,17 @@ void AddUiColorMixer(ColorProvider* provider,
                                             : SkColorSetA(SK_ColorBLACK, 0x80)};
   mixer[kColorScrollbarTrack] = {dark_mode ? SkColorSetRGB(0x42, 0x42, 0x42)
                                            : SkColorSetRGB(0xF1, 0xF1, 0xF1)};
+  mixer[kColorResultsTableNormalBackground] = {SK_ColorWHITE};
+  mixer[kColorResultsTableHoveredBackground] =
+      SetAlpha(kColorResultsTableNormalText, 0x0D);
+  mixer[kColorResultsTableNormalText] = {SK_ColorBLACK};
+  mixer[kColorResultsTableDimmedText] = {SkColorSetRGB(0x64, 0x64, 0x64)};
+  if (dark_mode) {
+    mixer[kColorResultsTableNormalBackground] = {SkColorSetRGB(0x28, 0x28, 0x28)};
+    mixer[kColorResultsTableNormalText] = {SK_ColorWHITE};
+    mixer[kColorResultsTableDimmedText] =
+      SetAlpha(kColorResultsTableNormalText, 0x80);
+  }
   mixer[kColorSeparator] = {kColorMidground};
   mixer[kColorShadowBase] = {dark_mode ? SK_ColorBLACK : gfx::kGoogleGrey800};
   mixer[kColorShadowValueAmbientShadowElevationThree] =
@@ -322,6 +333,7 @@ void AddUiColorMixer(ColorProvider* provider,
   mixer[kColorTreeNodeForegroundSelectedFocused] = {kColorTreeNodeForeground};
   mixer[kColorTreeNodeForegroundSelectedUnfocused] = {
       kColorTreeNodeForegroundSelectedFocused};
+  mixer[kColorUnfocusedBorder] = {kColorMidground};
   mixer[kColorWindowBackground] = {kColorPrimaryBackground};
 }
 
diff --git a/ui/color/win/native_color_mixers_win.cc b/ui/color/win/native_color_mixers_win.cc
index d6c783d34e84c0fb5485b099f527f95dd158e226..7a676e39e0de3c2ab7628cc2f951ee1212c47168 100644
--- a/ui/color/win/native_color_mixers_win.cc
+++ b/ui/color/win/native_color_mixers_win.cc
@@ -199,6 +199,10 @@ void AddNativeUiColorMixer(ColorProvider* provider,
       SetAlpha(kColorNotificationInputForeground, gfx::kGoogleGreyAlpha700);
   mixer[kColorSliderTrack] = AlphaBlend(
       kColorNativeHighlight, kColorNativeWindow, gfx::kGoogleGreyAlpha400);
+  mixer[kColorResultsTableHoveredBackground] = AlphaBlend(
+      kColorNativeHighlight, kColorNativeWindow, gfx::kGoogleGreyAlpha400);
+  mixer[kColorResultsTableDimmedText] = AlphaBlend(
+      kColorNativeWindowText, kColorNativeWindow, gfx::kGoogleGreyAlpha600);
 
   // Window Background
   mixer[kColorBubbleFooterBackground] = {kColorNativeWindow};
@@ -207,6 +211,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
   mixer[kColorFrameInactive] = {ui::kColorNativeWindow};
   mixer[kColorPrimaryBackground] = {kColorNativeWindow};
   mixer[kColorTooltipBackground] = {kColorNativeWindow};
+  mixer[kColorResultsTableNormalBackground] = {kColorNativeWindow};
 
   // Window Text
   mixer[kColorAlertLowSeverity] = {kColorNativeWindowText};
@@ -220,6 +225,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
   mixer[kColorTableGroupingIndicator] = {kColorNativeWindowText};
   mixer[kColorThrobber] = {kColorNativeWindowText};
   mixer[kColorTooltipForeground] = {kColorNativeWindowText};
+  mixer[kColorResultsTableNormalText] = {kColorNativeWindowText};
 
   // Hyperlinks
   mixer[kColorLinkForegroundDefault] = {kColorNativeHotlight};
@@ -262,6 +268,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
   mixer[kColorTextfieldForeground] = {kColorNativeBtnText};
   mixer[kColorTextfieldForegroundPlaceholder] = {kColorNativeBtnText};
   mixer[kColorTextfieldForegroundDisabled] = {kColorNativeBtnText};
+  mixer[kColorUnfocusedBorder] = {kColorNativeBtnText};
 
   // Highlight/Selected Background
   mixer[kColorAccent] = {kColorNativeHighlight};
