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

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

Issue 2642893002: Adjust positioning of location bar icons. (Closed)
Patch Set: nits Created 3 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/bubble_icon_view.cc
diff --git a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
index a87aab9a4a1abf220b5d9c15a80ec9f3df69555b..cdd4a6e1700b7e7513a1a492450eaade2d6984f4 100644
--- a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/ui/views/location_bar/bubble_icon_view.h"
#include "chrome/browser/command_updater.h"
+#include "chrome/browser/ui/layout_constants.h"
+#include "chrome/browser/ui/views/location_bar/background_with_1_px_border.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/events/event.h"
@@ -59,7 +61,13 @@ bool BubbleIconView::GetTooltipText(const gfx::Point& p,
}
gfx::Size BubbleIconView::GetPreferredSize() const {
- return image_->GetPreferredSize();
+ gfx::Rect image_rect(image_->GetPreferredSize());
+ image_rect.Inset(-gfx::Insets(LocationBarView::kIconInteriorPadding));
+ DCHECK_EQ(image_rect.height(),
+ GetLayoutConstant(LOCATION_BAR_HEIGHT) -
+ 2 * (GetLayoutConstant(LOCATION_BAR_ELEMENT_PADDING) +
+ BackgroundWith1PxBorder::kLocationBarBorderThicknessDip));
+ return image_rect.size();
}
void BubbleIconView::Layout() {
« no previous file with comments | « chrome/browser/ui/layout_constants.cc ('k') | chrome/browser/ui/views/location_bar/content_setting_image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698