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

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: pkasting feedback 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..90d7643ef31e4b29986e1000584855416100d2a0 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,13 @@ 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.
- const int icon_padding = GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING);
- 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);
+ 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);
+ ConvertPointToTarget(image, this, &point);
return point;
}
@@ -1353,7 +1353,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