@@ -43,7 +43,7 @@ KeywordHintView::KeywordHintView(views::ButtonListener* listener,
43
43
constexpr int kPaddingInsideBorder = 5 ;
44
44
// Even though the border is 1 px thick visibly, it takes 1 DIP logically for
45
45
// the non-rounded style.
46
- const int horizontal_padding = BackgroundWith1PxBorder ::IsRounded ()
46
+ const int horizontal_padding = LocationBarView ::IsRounded ()
47
47
? GetCornerRadius ()
48
48
: kPaddingInsideBorder + 1 ;
49
49
chip_label_->SetBorder (
@@ -132,7 +132,7 @@ void KeywordHintView::SetKeyword(const base::string16& keyword) {
132
132
}
133
133
134
134
gfx::Insets KeywordHintView::GetInsets () const {
135
- if (!BackgroundWith1PxBorder ::IsRounded ())
135
+ if (!LocationBarView ::IsRounded ())
136
136
return gfx::Insets (0 ,
137
137
GetLayoutConstant (LOCATION_BAR_ICON_INTERIOR_PADDING));
138
138
@@ -175,7 +175,7 @@ void KeywordHintView::Layout() {
175
175
gfx::Size leading_size (leading_label_->GetPreferredSize ());
176
176
leading_label_->SetBounds (GetInsets ().left (), 0 ,
177
177
show_labels ? leading_size.width () : 0 , height ());
178
- const int chip_height = BackgroundWith1PxBorder ::IsRounded ()
178
+ const int chip_height = LocationBarView ::IsRounded ()
179
179
? GetLayoutConstant (LOCATION_BAR_ICON_SIZE) +
180
180
chip_container_->GetInsets ().height ()
181
181
: height ();
@@ -197,18 +197,19 @@ gfx::Size KeywordHintView::CalculatePreferredSize() const {
197
197
}
198
198
199
199
void KeywordHintView::OnBoundsChanged (const gfx::Rect & previous_bounds) {
200
- if (!BackgroundWith1PxBorder::IsRounded ())
201
- return ;
202
- const int chip_corner_radius = GetCornerRadius ();
203
- chip_label_->SetBorder (views::CreateEmptyBorder (
204
- gfx::Insets (GetInsets ().top (), chip_corner_radius, GetInsets ().bottom (),
205
- chip_corner_radius)));
200
+ if (LocationBarView::IsRounded ()) {
201
+ const int chip_corner_radius = GetCornerRadius ();
202
+ chip_label_->SetBorder (views::CreateEmptyBorder (
203
+ gfx::Insets (GetInsets ().top (), chip_corner_radius, GetInsets ().bottom (),
204
+ chip_corner_radius)));
205
+ }
206
+ views::Button::OnBoundsChanged (previous_bounds);
206
207
}
207
208
208
209
views::Label* KeywordHintView::CreateLabel (SkColor text_color,
209
210
SkColor background_color) {
210
211
views::Label* label =
211
- new views::Label (base::string16 (), BackgroundWith1PxBorder ::IsRounded ()
212
+ new views::Label (base::string16 (), LocationBarView ::IsRounded ()
212
213
? CONTEXT_OMNIBOX_DECORATION
213
214
: CONTEXT_OMNIBOX_PRIMARY);
214
215
label->SetEnabledColor (text_color);
@@ -218,7 +219,7 @@ views::Label* KeywordHintView::CreateLabel(SkColor text_color,
218
219
}
219
220
220
221
int KeywordHintView::GetCornerRadius () const {
221
- if (!BackgroundWith1PxBorder ::IsRounded ())
222
+ if (!LocationBarView ::IsRounded ())
222
223
return GetLayoutConstant (LOCATION_BAR_BUBBLE_CORNER_RADIUS);
223
224
return chip_container_->height () / 2 ;
224
225
}
0 commit comments