Chromium Code Reviews| Index: views/fill_layout.cc |
| diff --git a/views/fill_layout.cc b/views/fill_layout.cc |
| index 7bd1430a6804e16b12e36c85f27a8dd5cb1bee06..741f7e834b4080b63f87b8467f40e447ddf38b20 100644 |
| --- a/views/fill_layout.cc |
| +++ b/views/fill_layout.cc |
| @@ -11,7 +11,12 @@ namespace views { |
| /////////////////////////////////////////////////////////////////////////////// |
| // FillLayout |
| -FillLayout::FillLayout() { |
| +FillLayout::FillLayout() |
| + : exclude_insets_(false) { |
| +} |
| + |
| +FillLayout::FillLayout(bool exclude_insets) |
| + : exclude_insets_(exclude_insets) { |
| } |
| FillLayout::~FillLayout() { |
| @@ -22,7 +27,14 @@ void FillLayout::Layout(View* host) { |
| return; |
| View* frame_view = host->GetChildViewAt(0); |
| - frame_view->SetBounds(0, 0, host->width(), host->height()); |
| + if (exclude_insets_) { |
|
Peter Kasting
2011/01/20 19:44:37
Nit: Simpler:
gfx::Insets insets(exclude_insets
|
| + gfx::Insets insets = host->GetInsets(); |
| + frame_view->SetBounds(insets.left(), insets.top(), |
| + host->width() - insets.width(), |
| + host->height() - insets.height()); |
| + } else { |
| + frame_view->SetBounds(0, 0, host->width(), host->height()); |
| + } |
| } |
| gfx::Size FillLayout::GetPreferredSize(View* host) { |