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

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: Fix win bots 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/gfx/text_elider.cc ('K') | « ui/views/corewm/tooltip_controller_unittest.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..5f6063bc497ef2512f2a56194839be1a1c0fd16b 100644
--- a/ui/views/widget/tooltip_manager.cc
+++ b/ui/views/widget/tooltip_manager.cc
@@ -18,6 +18,7 @@ const size_t kMaxTooltipLength = 1024;
// Maximum number of lines we allow in the tooltip.
const size_t kMaxLines = 6;
+
msw 2013/10/01 02:42:48 nit: remove this blank line
jianli 2013/10/01 18:56:50 Done.
namespace views {
// static
@@ -52,8 +53,8 @@ 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<int>(
+ *max_width, gfx::GetStringWidth(elided_text, font_list));
if (!result.empty())
result.push_back('\n');
result.append(elided_text);
« ui/gfx/text_elider.cc ('K') | « ui/views/corewm/tooltip_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698