OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/views/layout/fill_layout.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "ui/views/view.h" |
| 9 |
| 10 namespace ui { |
| 11 |
| 12 //////////////////////////////////////////////////////////////////////////////// |
| 13 // FillLayout, public: |
| 14 |
| 15 FillLayout::FillLayout() { |
| 16 } |
| 17 |
| 18 FillLayout::~FillLayout() { |
| 19 } |
| 20 |
| 21 //////////////////////////////////////////////////////////////////////////////// |
| 22 // FillLayout, LayoutManager implementation: |
| 23 |
| 24 void FillLayout::Layout(View* host) { |
| 25 if (host->child_count() == 0) |
| 26 return; |
| 27 |
| 28 View* child = host->GetChildViewAt(0); |
| 29 child->SetBounds(0, 0, host->width(), host->height()); |
| 30 } |
| 31 |
| 32 gfx::Size FillLayout::GetPreferredSize(View* host) { |
| 33 DCHECK(host->child_count() == 1); |
| 34 return host->GetChildViewAt(0)->GetPreferredSize(); |
| 35 } |
| 36 |
| 37 } // namespace ui |
OLD | NEW |