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

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

Issue 2786703004: Gtk3: Fix DCHECK on 3.20 (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | 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 120cd769762500c19b2c45e588c608819f1400ae..a5224ead3ea6892ab49ecc52df471cdf6578f0f6 100644
--- a/chrome/browser/ui/libgtkui/gtk_util.cc
+++ b/chrome/browser/ui/libgtkui/gtk_util.cc
@@ -530,6 +530,12 @@ SkColor GetSelectionBgColor(const std::string& css_selector) {
return GdkRgbaToSkColor(selection_color);
}
+bool ContextHasClass(GtkStyleContext* context, const std::string& style_class) {
+ return gtk_style_context_has_class(context, style_class.c_str()) ||
+ gtk_widget_path_iter_has_class(gtk_style_context_get_path(context), -1,
+ style_class.c_str());
+}
+
SkColor GetSeparatorColor(const std::string& css_selector) {
if (!GtkVersionCheck(3, 20))
return GetFgColor(css_selector);
@@ -545,12 +551,12 @@ SkColor GetSeparatorColor(const std::string& css_selector) {
w += border.left + padding.left + padding.right + border.right;
h += border.top + padding.top + padding.bottom + border.bottom;
- bool horizontal = gtk_style_context_has_class(context, "horizontal");
+ bool horizontal = ContextHasClass(context, "horizontal");
if (horizontal) {
w = 24;
h = std::max(h, 1);
} else {
- DCHECK(gtk_style_context_has_class(context, "vertical"));
+ DCHECK(ContextHasClass(context, "vertical"));
h = 24;
w = std::max(w, 1);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698