Commit 1db45fd0 authored by Kevin Bailey's avatar Kevin Bailey Committed by Commit Bot

[omnibox] Fix two-line view inset and image choice

We missed a place where an inset needed to be tweaked for tab switch
suggestions. Also, it was choosing the wrong image for rich + tab
switch suggestion.

Bug: 780835
Change-Id: I2f74618584480d9857a5e5c5e7c82636735d7c6b
Reviewed-on: https://chromium-review.googlesource.com/1102913Reviewed-by: default avatarDave Schuyler <dschuyler@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568015}
parent 1edd192f
...@@ -348,7 +348,8 @@ const char* OmniboxMatchCellView::GetClassName() const { ...@@ -348,7 +348,8 @@ const char* OmniboxMatchCellView::GetClassName() const {
void OmniboxMatchCellView::Layout() { void OmniboxMatchCellView::Layout() {
// Update the margins. // Update the margins.
gfx::Insets insets = GetMarginInsets( gfx::Insets insets = GetMarginInsets(
content()->GetLineHeight(), is_rich_suggestion_ || is_old_style_answer_); content()->GetLineHeight(),
is_rich_suggestion_ || has_tab_match_ || is_old_style_answer_);
SetBorder(views::CreateEmptyBorder(insets.top(), insets.left(), SetBorder(views::CreateEmptyBorder(insets.top(), insets.left(),
insets.bottom(), insets.right())); insets.bottom(), insets.right()));
// Layout children *after* updating the margins. // Layout children *after* updating the margins.
...@@ -401,10 +402,10 @@ void OmniboxMatchCellView::LayoutNewStyleTwoLineSuggestion() { ...@@ -401,10 +402,10 @@ void OmniboxMatchCellView::LayoutNewStyleTwoLineSuggestion() {
int x = child_area.x(); int x = child_area.x();
int y = child_area.y(); int y = child_area.y();
views::ImageView* image_view; views::ImageView* image_view;
if (has_tab_match_) { if (is_rich_suggestion_) {
image_view = icon_view_;
} else {
image_view = image_view_; image_view = image_view_;
} else {
image_view = icon_view_;
} }
image_view->SetBounds(x, y, kRefreshImageBoxSize, child_area.height()); image_view->SetBounds(x, y, kRefreshImageBoxSize, child_area.height());
const int text_width = child_area.width() - kTextIndent; const int text_width = child_area.width() - kTextIndent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment