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

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

Issue 1627543002: Anchor the infobar arrow to the LocationIconView correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 4 years, 11 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/location_bar_view.cc
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 24ff38073a625cbc84960b94cd24fe596b0312ff..26a15f352a31cfae7273305a994c6469ed219eb1 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -445,13 +445,12 @@ void LocationBarView::SelectAll() {
}
gfx::Point LocationBarView::GetLocationBarAnchorPoint() const {
- // The +1 in the next line creates a 1-px gap between icon and arrow tip.
- const int icon_padding = GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING);
Evan Stade 2016/01/22 23:58:37 I've no idea why this calculation made sense as th
Peter Kasting 2016/01/23 00:13:41 In pre-MD, the ICON_LABEL_VIEW_TRAILING_PADDING wa
Evan Stade 2016/01/23 00:37:26 This CL is attempting to fix a regression and is d
Peter Kasting 2016/01/23 01:25:28 If you want to merge, then don't touch the calcula
- gfx::Point icon_bottom(
- 0, location_icon_view_->GetImageBounds().bottom() - icon_padding + 1);
- gfx::Point icon_center(location_icon_view_->GetImageBounds().CenterPoint());
- gfx::Point point(icon_center.x(), icon_bottom.y());
- ConvertPointToTarget(location_icon_view_, this, &point);
+ 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() - 1;
+ gfx::Point icon_center(image->GetImageBounds().CenterPoint());
+ gfx::Point point(icon_center.x(), icon_bottom);
+ ConvertPointToTarget(image, this, &point);
return point;
}
@@ -1353,7 +1352,7 @@ void LocationBarView::AnimationEnded(const gfx::Animation* animation) {
void LocationBarView::OnChanged() {
RefreshLocationIcon();
- location_icon_view_->ShowTooltip(!GetOmniboxView()->IsEditingOrEmpty());
+ location_icon_view_->set_show_tooltip(!GetOmniboxView()->IsEditingOrEmpty());
Layout();
SchedulePaint();
}

Powered by Google App Engine
This is Rietveld 408576698