| Index: ui/views/controls/table/table_view.cc
|
| diff --git a/ui/views/controls/table/table_view.cc b/ui/views/controls/table/table_view.cc
|
| index 9ef4fe95a81979c279f87de6411fcd19cdd168a3..0d67a6ffb0f1ab483c938a5d519babac0123fe05 100644
|
| --- a/ui/views/controls/table/table_view.cc
|
| +++ b/ui/views/controls/table/table_view.cc
|
| @@ -305,17 +305,16 @@ int TableView::ViewToModel(int view_index) const {
|
| }
|
|
|
| void TableView::Layout() {
|
| - // parent()->parent() is the scrollview. When its width changes we force
|
| - // recalculating column sizes.
|
| - View* scroll_view = parent() ? parent()->parent() : NULL;
|
| + // When the scroll view width changes, recalculate column sizes.
|
| + ScrollView* scroll_view = EnclosingScrollView();
|
| if (scroll_view) {
|
| const int scroll_view_width = scroll_view->GetContentsBounds().width();
|
| if (scroll_view_width != last_parent_width_) {
|
| last_parent_width_ = scroll_view_width;
|
| if (!in_set_visible_column_width_) {
|
| - // Layout to the parent (the Viewport), which differs from
|
| + // Layout to the visible width (the Viewport), which differs from
|
| // |scroll_view_width| when scrollbars are present.
|
| - layout_width_ = parent()->width();
|
| + layout_width_ = scroll_view->GetVisibleRect().width();
|
| UpdateVisibleColumnSizes();
|
| }
|
| }
|
|
|