Chromium Code Reviews| Index: chrome/browser/ui/views/find_bar_view.cc |
| diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc |
| index 40b16b7009903039c3a98002940b58c329edae42..10bbf300e8e717a37b8155328187d3a87aa375ba 100644 |
| --- a/chrome/browser/ui/views/find_bar_view.cc |
| +++ b/chrome/browser/ui/views/find_bar_view.cc |
| @@ -332,35 +332,30 @@ void FindBarView::Layout() { |
| if (view_width && view_width < panel_width) |
| panel_width = view_width; |
| - // First we draw the close button on the far right. |
| - gfx::Size sz = close_button_->GetPreferredSize(); |
| - close_button_->SetBounds(panel_width - sz.width() - |
| - kMarginRightOfCloseButton, |
| - (height() - sz.height()) / 2, |
| - sz.width(), |
| - sz.height()); |
| // Set the color. |
| OnThemeChanged(); |
| + // First we draw the close button on the far right. |
|
sky
2016/03/22 23:57:06
draw->position.
Evan Stade
2016/03/23 00:00:26
Done.
|
| + close_button_->SizeToPreferredSize(); |
| + close_button_->SetPosition(gfx::Point( |
| + panel_width - close_button_->width() - kMarginRightOfCloseButton, |
| + (height() - close_button_->height()) / 2)); |
| + |
| // Next, the FindNext button to the left the close button. |
| - sz = find_next_button_->GetPreferredSize(); |
| - find_next_button_->SetBounds(close_button_->x() - |
| - find_next_button_->width() - |
| - kMarginLeftOfCloseButton, |
| - (height() - sz.height()) / 2, |
| - sz.width(), |
| - sz.height()); |
| + find_next_button_->SizeToPreferredSize(); |
| + find_next_button_->SetPosition( |
| + gfx::Point(close_button_->x() - find_next_button_->width() - |
| + kMarginLeftOfCloseButton, |
| + (height() - find_next_button_->height()) / 2)); |
| // Then, the FindPrevious button to the left the FindNext button. |
| - sz = find_previous_button_->GetPreferredSize(); |
| - find_previous_button_->SetBounds(find_next_button_->x() - |
| - find_previous_button_->width(), |
| - (height() - sz.height()) / 2, |
| - sz.width(), |
| - sz.height()); |
| + find_previous_button_->SizeToPreferredSize(); |
| + find_previous_button_->SetPosition(gfx::Point( |
| + find_next_button_->x() - find_previous_button_->width(), |
| + (height() - find_previous_button_->height()) / 2)); |
| // Then the label showing the match count number. |
| - sz = match_count_text_->GetPreferredSize(); |
| + gfx::Size sz = match_count_text_->GetPreferredSize(); |
| // We extend the label bounds a bit to give the background highlighting a |
| // bit of breathing room (margins around the text). |
| sz.Enlarge(kMatchCountExtraWidth, 0); |