Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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 #import "chrome/browser/ui/cocoa/layout_view.h" | |
| 6 | |
| 7 #include "chrome/browser/ui/cocoa/simple_grid_layout.h" | |
| 8 | |
| 9 @implementation LayoutView | |
| 10 | |
| 11 - (void)setLayoutManager:(scoped_ptr<SimpleGridLayout>) layout { | |
|
Robert Sesek
2013/05/02 20:16:46
nit: no space after )
groby-ooo-7-16
2013/05/03 04:31:46
Done.
| |
| 12 layout_ = layout.Pass(); | |
| 13 } | |
| 14 | |
| 15 - (SimpleGridLayout*)layoutManager { | |
| 16 return layout_.get(); | |
| 17 } | |
| 18 | |
| 19 - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize { | |
| 20 [super resizeSubviewsWithOldSize:oldBoundsSize]; | |
| 21 [self performLayout]; | |
| 22 } | |
| 23 | |
| 24 - (void)performLayout { | |
| 25 layout_->Layout(self); | |
| 26 } | |
| 27 | |
| 28 - (CGFloat)preferredHeightForWidth:(CGFloat)width { | |
| 29 return layout_->GetPreferredHeightForWidth(width); | |
| 30 } | |
| 31 | |
| 32 @end | |
| 33 | |
| OLD | NEW |