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

Unified Diff: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc

Issue 149383002: Clean-up: Replace Canvas::DrawStringInt with DrawStringRect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed the build break. Created 6 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 | « ash/shell/lock_view.cc ('k') | ui/views/controls/menu/menu_item_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
index ab8a690ea6d3cb2fb32ef932e78913fded31cd33..dc950e177b52609fa15178ce95cdef27249bbce1 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
@@ -26,7 +26,8 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas_skia_paint.h"
-#include "ui/gfx/font.h"
+#include "ui/gfx/font_list.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/text_elider.h"
@@ -151,11 +152,9 @@ gboolean OnDragIconExpose(GtkWidget* sender,
gfx::CanvasSkiaPaint canvas(event, false);
int text_x = gdk_pixbuf_get_width(data->favicon) + kBarButtonPadding;
int text_width = allocation.width - text_x;
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- const gfx::Font& base_font = rb.GetFont(ui::ResourceBundle::BaseFont);
- canvas.DrawStringInt(data->text, base_font, data->text_color,
- text_x, 0, text_width, allocation.height,
- gfx::Canvas::NO_SUBPIXEL_RENDERING);
+ const gfx::Rect rect(text_x, 0, text_width, allocation.height);
+ canvas.DrawStringRectWithFlags(data->text, gfx::FontList(), data->text_color,
+ rect, gfx::Canvas::NO_SUBPIXEL_RENDERING);
return TRUE;
}
@@ -205,10 +204,8 @@ GtkWidget* GetDragRepresentation(GdkPixbuf* pixbuf,
g_object_ref(window);
g_signal_connect(window, "destroy", G_CALLBACK(OnDragIconDestroy), data);
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- const gfx::Font& base_font = rb.GetFont(ui::ResourceBundle::BaseFont);
gtk_widget_set_size_request(window, kDragRepresentationWidth,
- base_font.GetHeight());
+ gfx::FontList().GetHeight());
} else {
if (!provider->UsingNativeTheme()) {
GdkColor color = provider->GetGdkColor(
« no previous file with comments | « ash/shell/lock_view.cc ('k') | ui/views/controls/menu/menu_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698