| Index: ui/views/controls/scroll_view.cc
|
| diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
|
| index 8a0c2590e8d2eae11644a63eddd61455fc6c0fa6..cf212b7c8bd3c99d10b268ab234d9acf05508a54 100644
|
| --- a/ui/views/controls/scroll_view.cc
|
| +++ b/ui/views/controls/scroll_view.cc
|
| @@ -283,7 +283,7 @@ gfx::Size ScrollView::GetPreferredSize() const {
|
| if (!is_bounded())
|
| return View::GetPreferredSize();
|
|
|
| - gfx::Size size = contents()->GetPreferredSize();
|
| + gfx::Size size = contents_->GetPreferredSize();
|
| size.SetToMax(gfx::Size(size.width(), min_height_));
|
| size.SetToMin(gfx::Size(size.width(), max_height_));
|
| gfx::Insets insets = GetInsets();
|
| @@ -297,7 +297,7 @@ int ScrollView::GetHeightForWidth(int width) const {
|
|
|
| gfx::Insets insets = GetInsets();
|
| width = std::max(0, width - insets.width());
|
| - int height = contents()->GetHeightForWidth(width) + insets.height();
|
| + int height = contents_->GetHeightForWidth(width) + insets.height();
|
| return std::min(std::max(height, min_height_), max_height_);
|
| }
|
|
|
| @@ -308,13 +308,12 @@ void ScrollView::Layout() {
|
| gfx::Rect available_rect = GetContentsBounds();
|
| if (is_bounded()) {
|
| int content_width = available_rect.width();
|
| - int content_height = contents()->GetHeightForWidth(content_width);
|
| + int content_height = contents_->GetHeightForWidth(content_width);
|
| if (content_height > height()) {
|
| content_width = std::max(content_width - GetScrollBarWidth(), 0);
|
| - content_height = contents()->GetHeightForWidth(content_width);
|
| + content_height = contents_->GetHeightForWidth(content_width);
|
| }
|
| - if (contents()->bounds().size() != gfx::Size(content_width, content_height))
|
| - contents()->SetBounds(0, 0, content_width, content_height);
|
| + contents_->SetSize(gfx::Size(content_width, content_height));
|
| }
|
|
|
| // Most views will want to auto-fit the available space. Most of them want to
|
|
|