From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Kleinschmidt <jkleinsc@github.com>
Date: Thu, 20 Jun 2019 16:49:25 -0400
Subject: put_back_deleted_colors_for_autofill.patch

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/chrome/browser/ui/libgtkui/native_theme_gtk.cc b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
index ad87f4729fe2cec2cf6e12b5bfcaf68bccf0390d..b1c3fd0f798d520da0637268dcbd51ecde9b40a7 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
@@ -279,6 +279,27 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
     case ui::NativeTheme::kColorId_TableHeaderSeparator:
       return GetBorderColor("GtkTreeView#treeview.view GtkButton#button");
 
+    // Results Table  
+    case ui::NativeTheme::kColorId_ResultsTableNormalBackground:
+      return SkColorFromColorId(
+          ui::NativeTheme::kColorId_TextfieldDefaultBackground);
+    case ui::NativeTheme::kColorId_ResultsTableHoveredBackground:
+      return color_utils::AlphaBlend(
+          SkColorFromColorId(
+              ui::NativeTheme::kColorId_TextfieldDefaultBackground),
+          SkColorFromColorId(
+              ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused),
+          0.5f);
+    case ui::NativeTheme::kColorId_ResultsTableNormalText:
+      return SkColorFromColorId(
+          ui::NativeTheme::kColorId_TextfieldDefaultColor);
+    case ui::NativeTheme::kColorId_ResultsTableDimmedText:
+      return color_utils::AlphaBlend(
+          SkColorFromColorId(ui::NativeTheme::kColorId_TextfieldDefaultColor),
+          SkColorFromColorId(
+              ui::NativeTheme::kColorId_TextfieldDefaultBackground),
+          0.5f);
+
     // Throbber
     // TODO(thomasanderson): Render GtkSpinner directly.
     case ui::NativeTheme::kColorId_ThrobberSpinningColor:
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
index 7fd49a2e26968daaa16ed3322b516f53ff60fb56..f902910ecc8e5b4945187e836655362ebba49204 100644
--- a/ui/native_theme/common_theme.cc
+++ b/ui/native_theme/common_theme.cc
@@ -56,6 +56,14 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
       case NativeTheme::kColorId_BubbleFooterBackground:
         return SkColorSetRGB(0x32, 0x36, 0x39);
 
+      // Results Tables
+      case NativeTheme::kColorId_ResultsTableNormalBackground:
+        return SkColorSetRGB(0x28, 0x28, 0x28);
+      case NativeTheme::kColorId_ResultsTableNormalText:
+        return SK_ColorWHITE;
+      case NativeTheme::kColorId_ResultsTableDimmedText:
+        return SkColorSetA(base_theme->GetSystemColor(NativeTheme::kColorId_ResultsTableNormalText), 0x80);
+
       // FocusableBorder
       case NativeTheme::kColorId_FocusedBorderColor:
         return SkColorSetA(gfx::kGoogleBlue300, 0x66);
@@ -359,6 +367,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
     case NativeTheme::kColorId_UnfocusedBorderColor:
       return SkColorSetA(SK_ColorBLACK, 0x66);
 
+    // Results Tables
+    case NativeTheme::kColorId_ResultsTableNormalBackground:
+      return SK_ColorWHITE;
+    case NativeTheme::kColorId_ResultsTableHoveredBackground:
+      return SkColorSetA(base_theme->GetSystemColor(
+                             NativeTheme::kColorId_ResultsTableNormalText),
+                         0x0D);
+    case NativeTheme::kColorId_ResultsTableNormalText:
+      return SK_ColorBLACK;
+    case NativeTheme::kColorId_ResultsTableDimmedText:
+      return SkColorSetRGB(0x64, 0x64, 0x64);
+
     // Material spinner/throbber
     case NativeTheme::kColorId_ThrobberSpinningColor:
       return gfx::kGoogleBlue600;
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index f1330721a711c61211ea136286ee884bc00e1975..e479fc84f7013984fc53d18cad8812fbd43cb670 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -389,6 +389,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
     kColorId_TableHeaderText,
     kColorId_TableHeaderBackground,
     kColorId_TableHeaderSeparator,
+    // Results Tables, such as the omnibox
+    kColorId_ResultsTableNormalBackground,
+    kColorId_ResultsTableHoveredBackground,
+    kColorId_ResultsTableNormalText,
+    kColorId_ResultsTableDimmedText,
     // Colors for the material spinner (aka throbber).
     kColorId_ThrobberSpinningColor,
     kColorId_ThrobberWaitingColor,
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 5b1804538c2e78af23c797004f250369580b4178..97e72bc38a7231ce295ad943e977c69586cc6e07 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -673,6 +673,17 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id,
     case kColorId_TableGroupingIndicatorColor:
       return system_colors_[SystemThemeColor::kGrayText];
 
+    // Results Tables
+    case kColorId_ResultsTableNormalBackground:
+      return system_colors_[SystemThemeColor::kWindow];
+    case kColorId_ResultsTableHoveredBackground:
+      return color_utils::AlphaBlend(system_colors_[SystemThemeColor::kWindowText],
+                                     system_colors_[SystemThemeColor::kWindow], 0.25f);
+    case kColorId_ResultsTableNormalText:
+      return system_colors_[SystemThemeColor::kWindowText];
+    case kColorId_ResultsTableDimmedText:
+      return color_utils::AlphaBlend(system_colors_[SystemThemeColor::kWindowText],
+                                     system_colors_[SystemThemeColor::kWindow], 0.5f);
     default:
       break;
   }
