Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(957)

Unified Diff: chrome/browser/ui/libgtkui/gtk_util.cc

Issue 2721493002: Gtk3: Fix GtkTextView colors (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk_util.h ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9463d533c50e19d1713d63b5152226d48638b88e..23808239b874d3c70d61ee4608c20d3f02f14ccc 100644
--- a/chrome/browser/ui/libgtkui/gtk_util.cc
+++ b/chrome/browser/ui/libgtkui/gtk_util.cc
@@ -492,24 +492,8 @@ SkColor GetBorderColor(const char* css_selector) {
return surface.GetAveragePixelValue(true);
}
-ScopedStyleContext GetSelectedStyleContext(const char* css_selector) {
+SkColor GetSelectionBgColor(const char* css_selector) {
auto context = GetStyleContextFromCss(css_selector);
- if (GtkVersionCheck(3, 20)) {
- context = AppendCssNodeToStyleContext(context, "#selection");
- } else {
- GtkStateFlags state = gtk_style_context_get_state(context);
- state = static_cast<GtkStateFlags>(state | GTK_STATE_FLAG_SELECTED);
- gtk_style_context_set_state(context, state);
- }
- return context;
-}
-
-SkColor GetSelectedTextColor(const char* css_selector) {
- return GetFgColorFromStyleContext(GetSelectedStyleContext(css_selector));
-}
-
-SkColor GetSelectedBgColor(const char* css_selector) {
- auto context = GetSelectedStyleContext(css_selector);
if (GtkVersionCheck(3, 20))
return GetBgColorFromStyleContext(context);
// This is verbatim how Gtk gets the selection color on versions before 3.20.
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk_util.h ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698