diff options
author | pkasting <pkasting@chromium.org> | 2016-03-25 14:58:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-25 22:00:02 +0000 |
commit | a614eb3fe5fba327416aac6ee990bda0f4a6654f (patch) | |
tree | 23030324dce890260163b6140182789d8d4246ee | |
parent | 317d7f244dbda5394b1f05a38bdb0938ec9fb7e1 (diff) | |
download | chromium_src-a614eb3fe5fba327416aac6ee990bda0f4a6654f.zip chromium_src-a614eb3fe5fba327416aac6ee990bda0f4a6654f.tar.gz chromium_src-a614eb3fe5fba327416aac6ee990bda0f4a6654f.tar.bz2 |
Fix infobar arrow tip position on MD.
On non-MD, this moves the tip down by 1 px, which basically looks better for
HTTPS and not worse for other cases.
On MD, this moves the tip down by 2 px, which makes it look perfect on non-EV
HTTPS, kinda crappy on EV, and OK everywhere else.
More importantly, it makes the tip vertical position not depend on a horizontal
layout constant, which kinda made sense in non-MD (based on how the constants
were designed there) and makes no sense at all for MD. This is important as I'm
about to change this constant's value in a way that would otherwise look awful
on MD.
Arguably, it might make sense to position the tip differently for all the
different icons, but hardcoding a bunch of different offsets like that makes my
hackles rise.
BUG=597921
TEST=On a brand new profile (so you get the "default browser" infobar on startup), set startup page to a non-EV HTTPS site. Start Chrome in Material Design mode. The infobar arrow should not intersect the lock icon.
Review URL: https://codereview.chromium.org/1832023002
Cr-Commit-Position: refs/heads/master@{#383374}
-rw-r--r-- | chrome/browser/ui/views/location_bar/location_bar_view.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index bb54d96..4b5a4a0 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -458,11 +458,8 @@ void LocationBarView::SelectAll() { gfx::Point LocationBarView::GetLocationBarAnchorPoint() const { const views::ImageView* image = location_icon_view_->GetImageView(); - // The +1 in the next line creates a 1-px gap between icon and arrow tip. - int icon_bottom = image->GetImageBounds().bottom() - - GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING) + 1; - gfx::Point icon_center(image->GetImageBounds().CenterPoint()); - gfx::Point point(icon_center.x(), icon_bottom); + const gfx::Rect image_bounds(image->GetImageBounds()); + gfx::Point point(image_bounds.CenterPoint().x(), image_bounds.bottom()); ConvertPointToTarget(image, this, &point); return point; } |