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

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

Issue 152343006: Clean-up: Replaces obsolete Font/FontList methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 6 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/gtk/tabs/tab_gtk.cc ('k') | chrome/browser/ui/views/accessibility/invert_bubble_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/validation_message_bubble_gtk.cc
diff --git a/chrome/browser/ui/gtk/validation_message_bubble_gtk.cc b/chrome/browser/ui/gtk/validation_message_bubble_gtk.cc
index c60c67b96ec0b1aa634e1412ae26f2eb191764b9..2a22d9157a12378aed659cc7478208c5164d3427 100644
--- a/chrome/browser/ui/gtk/validation_message_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/validation_message_bubble_gtk.cc
@@ -109,7 +109,7 @@ GtkWidget* ValidationMessageBubbleGtk::ConstructContent(
GtkWidget* sub_label = gtk_label_new(base::UTF16ToUTF8(sub_text).c_str());
const gfx::Font& sub_font = bundle.GetFont(ResourceBundle::BaseFont);
gtk_util::ForceFontSizePixels(sub_label, sub_font.GetHeight());
- int max_characters = kTextMaxWidth / sub_font.GetAverageCharacterWidth();
+ int max_characters = kTextMaxWidth / sub_font.GetExpectedTextWidth(1);
if (sub_text.length() > static_cast<size_t>(max_characters))
gtk_util::SetLabelWidth(sub_label, kTextMaxWidth);
gtk_box_pack_start(
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_gtk.cc ('k') | chrome/browser/ui/views/accessibility/invert_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698