Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / layout_view.mm
blob04881e2ccec1dda453461935c3176e2c7d8df19f
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.
5 #import "chrome/browser/ui/cocoa/autofill/layout_view.h"
7 #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h"
9 @implementation LayoutView
11 - (void)setLayoutManager:(scoped_ptr<SimpleGridLayout>)layout {
12   layout_ = layout.Pass();
15 - (SimpleGridLayout*)layoutManager {
16   return layout_.get();
19 - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
20   [super resizeSubviewsWithOldSize:oldBoundsSize];
21   [self performLayout];
24 - (void)performLayout {
25   layout_->Layout(self);
28 - (CGFloat)preferredHeightForWidth:(CGFloat)width {
29   return layout_->GetPreferredHeightForWidth(width);
32 @end