Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: ui/views/layout/fill_layout.cc

Issue 6541030: View API/implementation cleanup:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/focus/focus_search.cc ('k') | ui/views/rendering/border_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « ui/views/focus/focus_search.cc ('k') | ui/views/rendering/border_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698