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 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_LAYOUT_VIEW_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_LAYOUT_VIEW_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/memory/scoped_ptr.h"
12 class SimpleGridLayout
;
14 // A view that carries its own layout manager. Re-layouts on setFrame:.
15 @interface LayoutView
: NSView
{
17 scoped_ptr
<SimpleGridLayout
> layout_
;
20 // Sets a layout manager and takes ownership of it.
21 - (void)setLayoutManager
:(scoped_ptr
<SimpleGridLayout
>)layout
;
23 // Return a pointer to layout manager, still owned by the view.
24 - (SimpleGridLayout
*)layoutManager
;
26 // Re-layout subviews according to layout manager.
27 - (void)performLayout
;
29 // Query the layout manager for the best height for specified |width|.
30 - (CGFloat
)preferredHeightForWidth
:(CGFloat
)width
;
34 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_LAYOUT_VIEW_H_