diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/options/fonts_page_view.cc | 7 | ||||
-rw-r--r-- | chrome/browser/views/options/options_group_view.cc | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup.cc b/chrome/browser/autocomplete/autocomplete_popup.cc index 7f17572..e44ac90 100644 --- a/chrome/browser/autocomplete/autocomplete_popup.cc +++ b/chrome/browser/autocomplete/autocomplete_popup.cc @@ -624,7 +624,7 @@ AutocompletePopupView::DrawLineInfo::DrawLineInfo(const ChromeFont& font) { static const int kTotalLinePadding = 5; font_height = std::max(regular_font.height(), bold_font.height()); line_height = font_height + kTotalLinePadding; - ave_char_width = regular_font.ave_char_width(); + ave_char_width = regular_font.GetExpectedTextWidth(1); ellipsis_width = std::max(regular_font.GetStringWidth(ellipsis_str), bold_font.GetStringWidth(ellipsis_str)); diff --git a/chrome/browser/views/options/fonts_page_view.cc b/chrome/browser/views/options/fonts_page_view.cc index 3d94245..aa0b7be 100644 --- a/chrome/browser/views/options/fonts_page_view.cc +++ b/chrome/browser/views/options/fonts_page_view.cc @@ -172,7 +172,7 @@ void FontDisplayView::Layout() { gfx::Size FontDisplayView::GetPreferredSize() { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ChromeFont font = rb.GetFont(ResourceBundle::BaseFont); - return gfx::Size(font.ave_char_width() * kFontDisplayMaxWidthChars, + return gfx::Size(font.GetExpectedTextWidth(kFontDisplayMaxWidthChars), font.height() * kFontDisplayMaxHeightChars + 2 * kFontDisplayLabelPadding); } @@ -405,9 +405,8 @@ void FontsPageView::InitFontLayout() { const int triple_column_view_set_id = 0; ColumnSet* column_set = layout->AddColumnSet(triple_column_view_set_id); - int label_width = - _wtoi(l10n_util::GetString(IDS_FONTSLANG_LABEL_WIDTH).c_str()) * - ChromeFont().ave_char_width(); + int label_width = ChromeFont().GetExpectedTextWidth( + _wtoi(l10n_util::GetString(IDS_FONTSLANG_LABEL_WIDTH).c_str())); column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 0, GridLayout::FIXED, label_width, 0); column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); diff --git a/chrome/browser/views/options/options_group_view.cc b/chrome/browser/views/options/options_group_view.cc index 3fbbe08..bdf76ea 100644 --- a/chrome/browser/views/options/options_group_view.cc +++ b/chrome/browser/views/options/options_group_view.cc @@ -96,7 +96,7 @@ void OptionsGroupView::Init() { std::wstring left_column_chars = l10n_util::GetString(IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS); int left_column_width = - font.ave_char_width() * _wtoi(left_column_chars.c_str()); + font.GetExpectedTextWidth(_wtoi(left_column_chars.c_str())); const int two_column_layout_id = 0; ColumnSet* column_set = layout->AddColumnSet(two_column_layout_id); |