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

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

Issue 10406014: Add a ScopedPangoFontDescription helper class and use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/certificate_viewer_gtk.cc ('k') | ui/gfx/font.h » ('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
===================================================================
--- chrome/browser/ui/gtk/gtk_util.cc (revision 137485)
+++ chrome/browser/ui/gtk/gtk_util.cc (working copy)
@@ -45,6 +45,7 @@
#include "ui/base/x/x11_util.h"
#include "ui/gfx/image/cairo_cached_surface.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/pango_util.h"
// These conflict with base/tracked_objects.h, so need to come last.
#include <gdk/gdkx.h> // NOLINT
@@ -502,13 +503,12 @@
}
void ForceFontSizePixels(GtkWidget* widget, double size_pixels) {
- PangoFontDescription* font_desc = pango_font_description_new();
+ gfx::ScopedPangoFontDescription font_desc(pango_font_description_new());
// pango_font_description_set_absolute_size sets the font size in device
// units, which for us is pixels.
- pango_font_description_set_absolute_size(font_desc,
+ pango_font_description_set_absolute_size(font_desc.get(),
PANGO_SCALE * size_pixels);
- gtk_widget_modify_font(widget, font_desc);
- pango_font_description_free(font_desc);
+ gtk_widget_modify_font(widget, font_desc.get());
}
void UndoForceFontSize(GtkWidget* widget) {
« no previous file with comments | « chrome/browser/ui/gtk/certificate_viewer_gtk.cc ('k') | ui/gfx/font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698