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

Unified Diff: chrome/browser/ui/cocoa/autofill/layout_view.mm

Issue 14646021: [Autofill] Add basic version of GridLayout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra blank line. Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/autofill/layout_view.mm
diff --git a/chrome/browser/ui/cocoa/autofill/layout_view.mm b/chrome/browser/ui/cocoa/autofill/layout_view.mm
new file mode 100644
index 0000000000000000000000000000000000000000..04881e2ccec1dda453461935c3176e2c7d8df19f
--- /dev/null
+++ b/chrome/browser/ui/cocoa/autofill/layout_view.mm
@@ -0,0 +1,32 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/ui/cocoa/autofill/layout_view.h"
+
+#include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h"
+
+@implementation LayoutView
+
+- (void)setLayoutManager:(scoped_ptr<SimpleGridLayout>)layout {
+ layout_ = layout.Pass();
+}
+
+- (SimpleGridLayout*)layoutManager {
+ return layout_.get();
+}
+
+- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
+ [super resizeSubviewsWithOldSize:oldBoundsSize];
+ [self performLayout];
+}
+
+- (void)performLayout {
+ layout_->Layout(self);
+}
+
+- (CGFloat)preferredHeightForWidth:(CGFloat)width {
+ return layout_->GetPreferredHeightForWidth(width);
+}
+
+@end
« no previous file with comments | « chrome/browser/ui/cocoa/autofill/layout_view.h ('k') | chrome/browser/ui/cocoa/autofill/layout_view_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698