Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| index 9e3c44428699536ddf4387e36b59d5cc925bf7e0..dd8e6e33a095824f7917cb098f7895503e49d0ab 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -146,7 +146,11 @@ gfx::FontList GetLargestFontListWithHeightBound( |
| for (int font_size = font_list.GetFontSize(); font_size > 1; --font_size) { |
| const int internal_leading = |
| font_list.GetBaseline() - font_list.GetCapHeight(); |
| - const int space = height - font_list.GetCapHeight(); |
| + // If cap height is supported (i.e. internal_leading != 0), we have the cap |
| + // height centered. If not, we have the font height centered. |
|
Peter Kasting
2013/11/05 22:18:01
Nit: How about this:
Some platforms don't support
Yuki
2013/11/06 02:38:42
Done.
|
| + const int space = |
| + height - ((internal_leading != 0) ? |
| + font_list.GetCapHeight() : font_list.GetHeight()); |
| const int y_offset = space / 2 - internal_leading; |
| const int space_at_bottom = height - (y_offset + font_list.GetHeight()); |
| if ((y_offset >= 0) && (space_at_bottom >= 0)) |