Chromium Code Reviews| Index: chrome/browser/ui/location_bar/location_bar_util.cc |
| diff --git a/chrome/browser/ui/location_bar/location_bar_util.cc b/chrome/browser/ui/location_bar/location_bar_util.cc |
| index 381885933c8ec2c6a12e1f6262292a37c798175e..ddf622c5c07520ee07565eaff4dcc2af24b36d79 100644 |
| --- a/chrome/browser/ui/location_bar/location_bar_util.cc |
| +++ b/chrome/browser/ui/location_bar/location_bar_util.cc |
| @@ -17,9 +17,12 @@ base::string16 CalculateMinString(const base::string16& description) { |
| // Chop at the first '.' or whitespace. |
| const size_t chop_index = description.find_first_of( |
| base::kWhitespaceUTF16 + base::ASCIIToUTF16(".")); |
| - base::string16 min_string((chop_index == base::string16::npos) ? |
| - gfx::TruncateString(description, 3, gfx::WORD_BREAK) : |
| - description.substr(0, chop_index)); |
| + base::string16 min_string( |
| + (chop_index == base::string16::npos) |
| + ? |
| + // Show at least 4 characters plus an ellipsis. |
|
Peter Kasting
2017/02/25 06:17:11
Nit: This formatting is wacky. How about:
base
|
| + gfx::TruncateString(description, 5, gfx::WORD_BREAK) |
| + : description.substr(0, chop_index)); |
| base::i18n::AdjustStringForLocaleDirection(&min_string); |
| return min_string; |
| } |