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

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

Issue 1419673017: [MD] Twiddle padding of omnibox chips (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move constant to inline Created 5 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/icon_label_bubble_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
index 12a9e1b8ad24021627ad1b2484aba88353db00c4..ca74f1715fbd476385744435fe89e89cfe84ba08 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -140,15 +140,22 @@ gfx::Size IconLabelBubbleView::GetSizeForLabelWidth(int width) const {
return size;
}
-int IconLabelBubbleView::GetBubbleOuterPadding(bool start) const {
- // When the image is empty, leading and trailing padding are equal.
- const int extra_padding =
- image_->GetPreferredSize().IsEmpty() || !start
- ? GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING)
- : 0;
+int IconLabelBubbleView::GetBubbleOuterPadding(bool leading) const {
+ if (ui::MaterialDesignController::IsModeMaterial())
+ return GetBubbleOuterPaddingMd(leading);
+
return GetLayoutConstant(LOCATION_BAR_HORIZONTAL_PADDING) -
GetLayoutConstant(LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING) +
- extra_padding;
+ (leading ? 0 : GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING));
+}
+
+int IconLabelBubbleView::GetBubbleOuterPaddingMd(bool leading) const {
+ // When the image is empty, leading and trailing padding are equal.
+ if (image_->GetPreferredSize().IsEmpty() || !leading)
+ return GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING);
+
+ // Leading padding is 2dp.
+ return 2;
}
void IconLabelBubbleView::SetLabelBackgroundColor(
« no previous file with comments | « chrome/browser/ui/views/location_bar/icon_label_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698