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 9871a29db66aefdd2d9333645d9a445a5511bb7d..d7bd218fcea1428957265ba79e16df1c00037127 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
@@ -292,6 +292,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 381f75f76757666adc5cbaf8274b0e9fed55c261..8a8ebeeeaa7942003ee7fc7898e79e12818f0c10 100644
--- a/ui/native_theme/common_theme.cc
+++ b/ui/native_theme/common_theme.cc
@@ -59,6 +59,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, 0x4D);
@@ -391,6 +399,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
     case NativeTheme::kColorId_UnfocusedBorderColor:
       return gfx::kGoogleGrey300;
 
+    // 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 d266d92f9ceec23d38430ada176b753b34005749..183fe5b316697e9478751bab4766238ec8e29bd2 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -397,6 +397,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 a7c06b8a046bba7096bfb41c84d2073980ffa6d3..cff7681a4e0023a67edda37bf9865ab073b32549 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -619,6 +619,18 @@ SkColor NativeThemeWin::GetPlatformHighContrastColor(ColorId color_id) const {
     case kColorId_ThrobberWaitingColor:
       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);
+
     // Button Background
     case kColorId_MenuBackgroundColor:
     case kColorId_HighlightedMenuItemBackgroundColor:
