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

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

Issue 9147044: GTK: More GSEALing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: jhawkins refactor Created 8 years, 11 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/gtk/gtk_custom_menu_item.cc ('k') | chrome/browser/ui/gtk/nine_box.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/gtk_util.cc
diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc
index c963216a08ad971287610ef464e0f25c9d8c8940..f8e0e5907e31384ac25bd1b1171488817d898bd5 100644
--- a/chrome/browser/ui/gtk/gtk_util.cc
+++ b/chrome/browser/ui/gtk/gtk_util.cc
@@ -108,8 +108,9 @@ int GetCharacterWidthForPixels(GtkWidget* widget, int pixel_width) {
<< " widget must be realized to compute font metrics correctly";
PangoContext* context = gtk_widget_create_pango_context(widget);
+ GtkStyle* style = gtk_widget_get_style(widget);
PangoFontMetrics* metrics = pango_context_get_metrics(context,
- widget->style->font_desc, pango_context_get_language(context));
+ style->font_desc, pango_context_get_language(context));
// This technique (max of char and digit widths) matches the code in
// gtklabel.c.
@@ -280,8 +281,9 @@ void GetWidgetSizeFromCharacters(
DCHECK(gtk_widget_get_realized(widget))
<< " widget must be realized to compute font metrics correctly";
PangoContext* context = gtk_widget_create_pango_context(widget);
+ GtkStyle* style = gtk_widget_get_style(widget);
PangoFontMetrics* metrics = pango_context_get_metrics(context,
- widget->style->font_desc, pango_context_get_language(context));
+ style->font_desc, pango_context_get_language(context));
if (width) {
*width = static_cast<int>(
pango_font_metrics_get_approximate_char_width(metrics) *
« no previous file with comments | « chrome/browser/ui/gtk/gtk_custom_menu_item.cc ('k') | chrome/browser/ui/gtk/nine_box.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698