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