Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: ui/views/widget/tooltip_manager.cc

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/views/controls/label.cc ('K') | « ui/views/controls/tree/tree_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/tooltip_manager.cc
diff --git a/ui/views/widget/tooltip_manager.cc b/ui/views/widget/tooltip_manager.cc
index 7eb497876414050988535664288c09c614c058fa..f34bbe4fe2d0528b54e49cc75d315b7113745eca 100644
--- a/ui/views/widget/tooltip_manager.cc
+++ b/ui/views/widget/tooltip_manager.cc
@@ -52,8 +52,9 @@ void TooltipManager::TrimTooltipToFit(string16* text,
++i) {
string16 elided_text =
gfx::ElideText(*i, font_list, available_width, gfx::ELIDE_AT_END);
- *max_width = std::max(*max_width,
- gfx::GetStringWidth(elided_text, font_list));
+ *max_width = std::max(
+ *max_width,
+ static_cast<int>(gfx::GetStringWidth(elided_text, font_list)));
msw 2013/09/27 21:54:48 Use std::max<int> instead (or float if that's more
jianli 2013/10/01 00:32:58 Done.
if (!result.empty())
result.push_back('\n');
result.append(elided_text);
« ui/views/controls/label.cc ('K') | « ui/views/controls/tree/tree_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698