Chromium Code Reviews| Index: ui/views/controls/scrollbar/base_scroll_bar.cc |
| diff --git a/ui/views/controls/scrollbar/base_scroll_bar.cc b/ui/views/controls/scrollbar/base_scroll_bar.cc |
| index 117fe345dffea247bef217e0c73e1210d7ea7b24..97194a9066e42ceb954c6d4dcbac27b4da0d6674 100644 |
| --- a/ui/views/controls/scrollbar/base_scroll_bar.cc |
| +++ b/ui/views/controls/scrollbar/base_scroll_bar.cc |
| @@ -128,6 +128,20 @@ void BaseScrollBar::OnThumbStateChanged(CustomButton::ButtonState old_state, |
| /////////////////////////////////////////////////////////////////////////////// |
| // BaseScrollBar, View implementation: |
| +void BaseScrollBar::Layout() { |
|
tapted
2016/02/22 04:42:15
If we keep this here, the identical logic can be r
spqchan
2016/02/22 19:01:37
Done.
|
| + // Provide a default implementation that sets the thumb's bounds in the |
| + // scrollbar. |
| + gfx::Rect thumb_bounds = GetTrackBounds(); |
| + if (IsHorizontal()) { |
| + thumb_bounds.set_x(thumb_->x()); |
| + thumb_bounds.set_width(thumb_->width()); |
| + } else { |
| + thumb_bounds.set_y(thumb_->y()); |
| + thumb_bounds.set_height(thumb_->height()); |
| + } |
| + thumb_->SetBoundsRect(thumb_bounds); |
| +} |
| + |
| bool BaseScrollBar::OnMousePressed(const ui::MouseEvent& event) { |
| if (event.IsOnlyLeftMouseButton()) |
| ProcessPressEvent(event); |