Index: chrome/browser/ui/libgtkui/gtk_util.cc |
diff --git a/chrome/browser/ui/libgtkui/gtk_util.cc b/chrome/browser/ui/libgtkui/gtk_util.cc |
index 23808239b874d3c70d61ee4608c20d3f02f14ccc..6c10b434ad309ddbab917b9f207390ba42f41755 100644 |
--- a/chrome/browser/ui/libgtkui/gtk_util.cc |
+++ b/chrome/browser/ui/libgtkui/gtk_util.cc |
@@ -278,6 +278,23 @@ bool GtkVersionCheck(int major, int minor, int micro) { |
return false; |
} |
+GtkStateFlags StateToStateFlags(ui::NativeTheme::State state) { |
+ switch (state) { |
+ case ui::NativeTheme::kDisabled: |
+ return GTK_STATE_FLAG_INSENSITIVE; |
+ case ui::NativeTheme::kHovered: |
+ return GTK_STATE_FLAG_PRELIGHT; |
+ case ui::NativeTheme::kNormal: |
+ return GTK_STATE_FLAG_NORMAL; |
+ case ui::NativeTheme::kPressed: |
+ return static_cast<GtkStateFlags>(GTK_STATE_FLAG_PRELIGHT | |
+ GTK_STATE_FLAG_ACTIVE); |
+ default: |
+ NOTREACHED(); |
+ return GTK_STATE_FLAG_NORMAL; |
+ } |
+} |
+ |
ScopedStyleContext AppendCssNodeToStyleContext(GtkStyleContext* context, |
const std::string& css_node) { |
GtkWidgetPath* path = |