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

Unified Diff: chrome/browser/ui/views/status_bubble_views.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
Index: chrome/browser/ui/views/status_bubble_views.cc
diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc
index 6e89dec5e895c237790f1d0be06bdfaaff177263..0ae18dc81b2f4483e3b8432cd55654f4de111e7e 100644
--- a/chrome/browser/ui/views/status_bubble_views.cc
+++ b/chrome/browser/ui/views/status_bubble_views.cc
@@ -434,7 +434,7 @@ void StatusBubbleViews::StatusView::OnPaint(gfx::Canvas* canvas) {
// Draw highlight text and then the text body. In order to make sure the text
// is aligned to the right on RTL UIs, we mirror the text bounds if the
// locale is RTL.
- int text_width = std::min(
+ int text_width = std::min<int>(
views::Label::font().GetStringWidth(text_),
width - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding);
int text_height = height - (kShadowThickness * 2);
@@ -824,10 +824,10 @@ void StatusBubbleViews::ExpandBubble() {
url_text_ = gfx::ElideUrl(url_, view_->Label::font(),
max_status_bubble_width, languages_);
int expanded_bubble_width =std::max(GetStandardStatusBubbleWidth(),
- std::min(view_->Label::font().GetStringWidth(url_text_) +
- (kShadowThickness * 2) + kTextPositionX +
- kTextHorizPadding + 1,
- max_status_bubble_width));
+ std::min<int>(view_->Label::font().GetStringWidth(url_text_) +
+ (kShadowThickness * 2) + kTextPositionX +
+ kTextHorizPadding + 1,
+ max_status_bubble_width));
is_expanded_ = true;
expand_view_->StartExpansion(url_text_, popup_bounds.width(),
expanded_bubble_width);

Powered by Google App Engine
This is Rietveld 408576698