Commit 5d275d1a authored by manuk's avatar manuk Committed by Commit Bot

Draw 1dp border around tab pill in `press tab to search ...` view.

Previously, BackgroundWith1PxBorder was used to draw the pill. We now use
a solid background and a RoundedRectBorder.

Bug: 840897
Change-Id: I19650f98dfff257ab770a37920174c5a36485ffb
Reviewed-on: https://chromium-review.googlesource.com/1148955Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578365}
parent 61befea7
...@@ -70,10 +70,11 @@ KeywordHintView::KeywordHintView(views::ButtonListener* listener, ...@@ -70,10 +70,11 @@ KeywordHintView::KeywordHintView(views::ButtonListener* listener,
} }
chip_label_->SetBackgroundColor(tab_bg_color); chip_label_->SetBackgroundColor(tab_bg_color);
chip_container_->SetBorder(views::CreateEmptyBorder( chip_container_->SetBackground(views::CreateSolidBackground(tab_bg_color));
gfx::Insets(GetLayoutConstant(LOCATION_BAR_BUBBLE_VERTICAL_PADDING), 0))); chip_container_->SetBorder(views::CreateRoundedRectBorder(
chip_container_->SetBackground(std::make_unique<BackgroundWith1PxBorder>( 1, GetLayoutConstant(LOCATION_BAR_BUBBLE_CORNER_RADIUS),
tab_bg_color, tab_border_color)); tab_border_color));
chip_container_->AddChildView(chip_label_); chip_container_->AddChildView(chip_label_);
chip_container_->SetLayoutManager(std::make_unique<views::FillLayout>()); chip_container_->SetLayoutManager(std::make_unique<views::FillLayout>());
AddChildView(chip_container_); AddChildView(chip_container_);
...@@ -206,10 +207,9 @@ void KeywordHintView::Layout() { ...@@ -206,10 +207,9 @@ void KeywordHintView::Layout() {
gfx::Size leading_size(leading_label_->GetPreferredSize()); gfx::Size leading_size(leading_label_->GetPreferredSize());
leading_label_->SetBounds(GetInsets().left(), 0, leading_label_->SetBounds(GetInsets().left(), 0,
show_labels ? leading_size.width() : 0, height()); show_labels ? leading_size.width() : 0, height());
const int chip_height = LocationBarView::IsRounded() const int chip_height = GetLayoutConstant(LOCATION_BAR_ICON_SIZE) +
? GetLayoutConstant(LOCATION_BAR_ICON_SIZE) + chip_container_->GetInsets().height();
chip_container_->GetInsets().height()
: height();
const int chip_vertical_padding = std::max(0, height() - chip_height) / 2; const int chip_vertical_padding = std::max(0, height() - chip_height) / 2;
chip_container_->SetBounds(leading_label_->bounds().right(), chip_container_->SetBounds(leading_label_->bounds().right(),
chip_vertical_padding, chip_width, chip_height); chip_vertical_padding, chip_width, chip_height);
......
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