Chromium Code Reviews| Index: ui/views/layout/fill_layout.cc |
| diff --git a/ui/views/layout/fill_layout.cc b/ui/views/layout/fill_layout.cc |
| index 21375461210b0d54256f975553c703ed2097021c..05102743eed89d43c5a8746e163264cd1ff34125 100644 |
| --- a/ui/views/layout/fill_layout.cc |
| +++ b/ui/views/layout/fill_layout.cc |
| @@ -16,14 +16,14 @@ void FillLayout::Layout(View* host) { |
| if (!host->has_children()) |
| return; |
| - View* frame_view = host->child_at(0); |
| - frame_view->SetBoundsRect(host->GetContentsBounds()); |
| + for (int i = 0; i < host->child_count(); ++i) { |
| + host->child_at(i)->SetBoundsRect(host->GetContentsBounds()); |
|
sky
2015/02/24 21:35:55
If you want to support multiple children shouldn't
Evan Stade
2015/02/24 22:07:02
That would be one possibility, but for this use ca
sky
2015/02/24 23:56:13
I'm pretty sure we don't want this behavior for Fi
|
| + } |
| } |
| gfx::Size FillLayout::GetPreferredSize(const View* host) const { |
| if (!host->has_children()) |
| return gfx::Size(); |
| - DCHECK_EQ(1, host->child_count()); |
| gfx::Rect rect(host->child_at(0)->GetPreferredSize()); |
| rect.Inset(-host->GetInsets()); |
| return rect.size(); |
| @@ -32,7 +32,6 @@ gfx::Size FillLayout::GetPreferredSize(const View* host) const { |
| int FillLayout::GetPreferredHeightForWidth(const View* host, int width) const { |
| if (!host->has_children()) |
| return 0; |
| - DCHECK_EQ(1, host->child_count()); |
| const gfx::Insets insets = host->GetInsets(); |
| return host->child_at(0)->GetHeightForWidth(width - insets.width()) + |
| insets.height(); |