Commit a7dfaf49 authored by Tommy Li's avatar Tommy Li Committed by Commit Bot

[omnibox] Fix size of Remove button in Views omnibox in touch-mode

Currently, in touch-mode, the Remove X looks wrong.

This CL scales the X button in touch-mode, just like the keyword hint
button.

Bug: 1030423, 1205
Change-Id: Iee991d6189ac4bff2166bba481eaa4df25fc07c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949488Reviewed-by: default avatarKevin Bailey <krb@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721499}
parent 61e1441a
......@@ -75,8 +75,9 @@ OmniboxResultView::OmniboxResultView(
AddChildView(views::CreateVectorImageButton(this));
views::InstallCircleHighlightPathGenerator(remove_suggestion_button_);
// TODO(tommycli): We may need to update the color for theme changes.
int icon_size = GetLayoutConstant(LOCATION_BAR_ICON_SIZE);
views::SetImageFromVectorIcon(remove_suggestion_button_,
vector_icons::kCloseRoundedIcon,
vector_icons::kCloseRoundedIcon, icon_size,
GetColor(OmniboxPart::RESULTS_ICON));
remove_suggestion_focus_ring_ =
views::FocusRing::Install(remove_suggestion_button_);
......@@ -87,9 +88,9 @@ OmniboxResultView::OmniboxResultView(
keyword_view_ = AddChildView(std::make_unique<OmniboxMatchCellView>(this));
keyword_view_->icon()->EnableCanvasFlippingForRTLUI(true);
keyword_view_->icon()->SetImage(gfx::CreateVectorIcon(
omnibox::kKeywordSearchIcon, GetLayoutConstant(LOCATION_BAR_ICON_SIZE),
GetColor(OmniboxPart::RESULTS_ICON)));
keyword_view_->icon()->SetImage(
gfx::CreateVectorIcon(omnibox::kKeywordSearchIcon, icon_size,
GetColor(OmniboxPart::RESULTS_ICON)));
keyword_view_->icon()->SizeToPreferredSize();
// Calling SetMatch() will result in the child OmniboxMatchCellViews
......
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