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

Unified Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc

Issue 2748103013: Adjust elision of omnibox keyword search label. (Closed)
Patch Set: Created 3 years, 9 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/location_bar/icon_label_bubble_view.cc
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
index 4a1ee58f508389df890a7b209b6a4dd1b1e56f21..7dca4b0f61a8c2faf8a038fa0ea7b7132f848e96 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -117,8 +117,8 @@ void IconLabelBubbleView::Layout() {
// the label has zero size it doesn't actually matter what we compute its X
// value to be, since it won't be visible.
const int label_x = image_->bounds().right() + GetInternalSpacing();
- const int label_width =
- std::max(0, width() - label_x - bubble_trailing_padding);
+ const int label_width = std::max(
+ 0, width() - label_x - bubble_trailing_padding - kSpaceBesideSeparator);
label_->SetBounds(label_x, 0, label_width, height());
}
@@ -229,13 +229,7 @@ void IconLabelBubbleView::OnPaint(gfx::Canvas* canvas) {
gfx::Rect bounds(label_->bounds());
const int kSeparatorHeight = 16;
bounds.Inset(0, (bounds.height() - kSeparatorHeight) / 2);
-
- // Draw the 1 px separator.
- gfx::ScopedCanvas scoped_canvas(canvas);
- const float scale = canvas->UndoDeviceScaleFactor();
- // Keep the separator aligned on a pixel center.
- const gfx::RectF pixel_aligned_bounds =
- gfx::ScaleRect(gfx::RectF(bounds), scale) - gfx::Vector2dF(0.5f, 0);
- canvas->DrawLine(pixel_aligned_bounds.top_right(),
- pixel_aligned_bounds.bottom_right(), separator_color);
+ bounds.set_width(bounds.width() + kSpaceBesideSeparator);
+ canvas->Draw1pxLine(gfx::PointF(bounds.top_right()),
+ gfx::PointF(bounds.bottom_right()), separator_color);
}
« no previous file with comments | « chrome/browser/ui/location_bar/location_bar_util.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698