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

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

Issue 1300843003: Change width of rows in material design omnibox dropdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no changes to PaintMatch() Created 5 years, 4 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/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 d716b57767e858e0bc7b5d107f630642efcd3ba8..934542e5176ea9038509cbdcb6a1de78c39fa38b 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -116,12 +116,17 @@ void OmniboxPopupContentsView::LayoutChildren() {
ThemeProperties::PROPERTY_OMNIBOX_DROPDOWN_MIN_TEXT_VERTICAL_PADDING);
gfx::Rect contents_rect = GetContentsBounds();
-
contents_rect.Inset(
- left_margin_,
- views::NonClientFrameView::kClientEdgeThickness + min_vertical_padding,
- right_margin_,
- min_vertical_padding);
+ 0, views::NonClientFrameView::kClientEdgeThickness + min_vertical_padding,
+ 0, min_vertical_padding);
+
+ // In the non-material dropdown, the colored/clickable regions within the
+ // dropdown are only as wide as the location bar. In the material version,
+ // these are full width, and OmniboxResultView instead insets the icons/text
+ // inside to be aligned with the location bar.
+ if (!ui::MaterialDesignController::IsModeMaterial())
+ contents_rect.Inset(left_margin_, 0, right_margin_, 0);
+
int top = contents_rect.y();
for (size_t i = 0; i < AutocompleteResult::kMaxMatches; ++i) {
View* v = child_at(i);

Powered by Google App Engine
This is Rietveld 408576698