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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 1832023002: Fix infobar arrow tip position on MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 show_focus_rect_ = show; 452 show_focus_rect_ = show;
453 SchedulePaint(); 453 SchedulePaint();
454 } 454 }
455 455
456 void LocationBarView::SelectAll() { 456 void LocationBarView::SelectAll() {
457 omnibox_view_->SelectAll(true); 457 omnibox_view_->SelectAll(true);
458 } 458 }
459 459
460 gfx::Point LocationBarView::GetLocationBarAnchorPoint() const { 460 gfx::Point LocationBarView::GetLocationBarAnchorPoint() const {
461 const views::ImageView* image = location_icon_view_->GetImageView(); 461 const views::ImageView* image = location_icon_view_->GetImageView();
462 // The +1 in the next line creates a 1-px gap between icon and arrow tip. 462 const gfx::Rect image_bounds(image->GetImageBounds());
463 int icon_bottom = image->GetImageBounds().bottom() - 463 gfx::Point point(image_bounds.CenterPoint().x(), image_bounds.bottom());
464 GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING) + 1;
465 gfx::Point icon_center(image->GetImageBounds().CenterPoint());
466 gfx::Point point(icon_center.x(), icon_bottom);
467 ConvertPointToTarget(image, this, &point); 464 ConvertPointToTarget(image, this, &point);
468 return point; 465 return point;
469 } 466 }
470 467
471 void LocationBarView::GetOmniboxPopupPositioningInfo( 468 void LocationBarView::GetOmniboxPopupPositioningInfo(
472 gfx::Point* top_left_screen_coord, 469 gfx::Point* top_left_screen_coord,
473 int* popup_width, 470 int* popup_width,
474 int* left_margin, 471 int* left_margin,
475 int* right_margin, 472 int* right_margin,
476 int top_edge_overlap) { 473 int top_edge_overlap) {
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 // LocationBarView, private TemplateURLServiceObserver implementation: 1385 // LocationBarView, private TemplateURLServiceObserver implementation:
1389 1386
1390 void LocationBarView::OnTemplateURLServiceChanged() { 1387 void LocationBarView::OnTemplateURLServiceChanged() {
1391 template_url_service_->RemoveObserver(this); 1388 template_url_service_->RemoveObserver(this);
1392 template_url_service_ = nullptr; 1389 template_url_service_ = nullptr;
1393 // If the browser is no longer active, let's not show the info bubble, as this 1390 // If the browser is no longer active, let's not show the info bubble, as this
1394 // would make the browser the active window again. 1391 // would make the browser the active window again.
1395 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) 1392 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive())
1396 ShowFirstRunBubble(); 1393 ShowFirstRunBubble();
1397 } 1394 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698