Chromium Code Reviews| Index: ash/system/user/tray_user.cc |
| diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc |
| index e83272758273f147848c66cb83b11b77f66a634c..5c97c80119bc36a3219c4f48fc678a611cf687f2 100644 |
| --- a/ash/system/user/tray_user.cc |
| +++ b/ash/system/user/tray_user.cc |
| @@ -455,8 +455,11 @@ void PublicAccountUserDetails::Layout() { |
| // Word-wrap the label text. |
| const gfx::Font font; |
| std::vector<base::string16> lines; |
| - gfx::ElideRectangleText(text_, font, contents_area.width(), |
| - contents_area.height(), gfx::ELIDE_LONG_WORDS, |
| + gfx::ElideRectangleText(text_, |
| + font, |
| + static_cast<float>(contents_area.width()), |
|
msw
2013/09/27 21:54:48
Won't int->float implicit type conversion work her
jianli
2013/10/01 00:32:58
Reverted. Changed INT_MAX to FLT_MAX in the follow
|
| + static_cast<float>(contents_area.height()), |
| + gfx::ELIDE_LONG_WORDS, |
| &lines); |
| // Loop through the lines, creating a renderer for each. |
| gfx::Point position = contents_area.origin(); |
| @@ -555,7 +558,8 @@ void PublicAccountUserDetails::CalculatePreferredSize(SystemTrayItem* owner, |
| lines.clear(); |
| const int width = (min_width + max_width) / 2; |
| const bool too_narrow = gfx::ElideRectangleText( |
| - text_, font, width, INT_MAX, gfx::TRUNCATE_LONG_WORDS, &lines) != 0; |
| + text_, font, static_cast<float>(width), static_cast<float>(INT_MAX), |
| + gfx::TRUNCATE_LONG_WORDS, &lines) != 0; |
| int line_count = lines.size(); |
| if (!too_narrow && line_count == 3 && |
| width - font.GetStringWidth(lines.back()) <= |
| @@ -571,7 +575,8 @@ void PublicAccountUserDetails::CalculatePreferredSize(SystemTrayItem* owner, |
| // Calculate the corresponding height and set the preferred size. |
| lines.clear(); |
| gfx::ElideRectangleText( |
| - text_, font, min_width, INT_MAX, gfx::TRUNCATE_LONG_WORDS, &lines); |
| + text_, font, static_cast<float>(min_width), static_cast<float>(INT_MAX), |
| + gfx::TRUNCATE_LONG_WORDS, &lines); |
| int line_count = lines.size(); |
| if (min_width - font.GetStringWidth(lines.back()) <= |
| space_width + link_size.width()) { |