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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc

Issue 2523783002: Top Chrome MD cleanup - get rid of most of GetLayoutInsets. (Closed)
Patch Set: fix typo Created 4 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
Index: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
index 04bb74bcb783ba4cd6281b2a1d5d38b63aed88aa..d6d30558582fb3810627bc3970545193c5bbc057 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -38,6 +38,8 @@ namespace {
base::LazyInstance<gfx::ImageSkia> g_top_shadow = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<gfx::ImageSkia> g_bottom_shadow = LAZY_INSTANCE_INITIALIZER;
+const int kPopupVerticalPadding = 4;
+
} // namespace
class OmniboxPopupContentsView::AutocompletePopupWidget
@@ -147,7 +149,7 @@ gfx::Rect OmniboxPopupContentsView::GetPopupBounds() const {
void OmniboxPopupContentsView::LayoutChildren() {
gfx::Rect contents_rect = GetContentsBounds();
- contents_rect.Inset(GetLayoutInsets(OMNIBOX_DROPDOWN));
+ contents_rect.Inset(gfx::Insets(kPopupVerticalPadding, 0));
contents_rect.Inset(start_margin_, g_top_shadow.Get().height(), end_margin_,
0);
@@ -434,7 +436,7 @@ int OmniboxPopupContentsView::CalculatePopupHeight() {
// Add enough space on the top and bottom so it looks like there is the same
// amount of space between the text and the popup border as there is in the
// interior between each row of text.
- return popup_height + GetLayoutInsets(OMNIBOX_DROPDOWN).height() +
+ return popup_height + kPopupVerticalPadding * 2 +
g_top_shadow.Get().height() + g_bottom_shadow.Get().height();
}

Powered by Google App Engine
This is Rietveld 408576698