summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/text_field.cc2
-rw-r--r--chrome/views/window.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/chrome/views/text_field.cc b/chrome/views/text_field.cc
index be8911d..baa70a1 100644
--- a/chrome/views/text_field.cc
+++ b/chrome/views/text_field.cc
@@ -847,7 +847,7 @@ void TextField::Layout() {
gfx::Size TextField::GetPreferredSize() {
gfx::Insets insets;
CalculateInsets(&insets);
- return gfx::Size(default_width_in_chars_ * font_.ave_char_width() +
+ return gfx::Size(font_.GetExpectedTextWidth(default_width_in_chars_) +
insets.width(),
num_lines_ * font_.height() + insets.height());
}
diff --git a/chrome/views/window.cc b/chrome/views/window.cc
index 0eaa599..1566584 100644
--- a/chrome/views/window.cc
+++ b/chrome/views/window.cc
@@ -251,7 +251,7 @@ gfx::Size Window::GetLocalizedContentsSize(int col_resource_id,
double chars = _wtof(l10n_util::GetString(col_resource_id).c_str());
double lines = _wtof(l10n_util::GetString(row_resource_id).c_str());
- int width = static_cast<int>(font.ave_char_width() * chars);
+ int width = font.GetExpectedTextWidth(static_cast<int>(chars));
int height = static_cast<int>(font.height() * lines);
DCHECK(width > 0 && height > 0);