| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 #import "chrome/browser/ui/cocoa/autofill/layout_view.h" | 5 #import "chrome/browser/ui/cocoa/autofill/layout_view.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h" | 9 #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h" |
| 8 | 10 |
| 9 @implementation LayoutView | 11 @implementation LayoutView |
| 10 | 12 |
| 11 - (void)setLayoutManager:(scoped_ptr<SimpleGridLayout>)layout { | 13 - (void)setLayoutManager:(scoped_ptr<SimpleGridLayout>)layout { |
| 12 layout_ = layout.Pass(); | 14 layout_ = std::move(layout); |
| 13 } | 15 } |
| 14 | 16 |
| 15 - (SimpleGridLayout*)layoutManager { | 17 - (SimpleGridLayout*)layoutManager { |
| 16 return layout_.get(); | 18 return layout_.get(); |
| 17 } | 19 } |
| 18 | 20 |
| 19 - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize { | 21 - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize { |
| 20 [super resizeSubviewsWithOldSize:oldBoundsSize]; | 22 [super resizeSubviewsWithOldSize:oldBoundsSize]; |
| 21 [self performLayout]; | 23 [self performLayout]; |
| 22 } | 24 } |
| 23 | 25 |
| 24 - (void)performLayout { | 26 - (void)performLayout { |
| 25 layout_->Layout(self); | 27 layout_->Layout(self); |
| 26 } | 28 } |
| 27 | 29 |
| 28 - (CGFloat)preferredHeightForWidth:(CGFloat)width { | 30 - (CGFloat)preferredHeightForWidth:(CGFloat)width { |
| 29 return layout_->GetPreferredHeightForWidth(width); | 31 return layout_->GetPreferredHeightForWidth(width); |
| 30 } | 32 } |
| 31 | 33 |
| 32 @end | 34 @end |
| OLD | NEW |