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