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

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

Issue 15645004: [rAC] Allow sub-views to trigger layout reflow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review issues. 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/autofill_main_container.mm
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm
index 7579555a6d0a99cc4019d777a1f7294dfa5ac3cb..80b050cc2af824efb5e45ae6cbbf224cff5412d5 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm
@@ -4,6 +4,9 @@
#import "chrome/browser/ui/cocoa/autofill/autofill_main_container.h"
+#include <algorithm>
+#include <cmath>
+
#include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h"
#import "chrome/browser/ui/cocoa/autofill/autofill_details_container.h"
@@ -49,6 +52,22 @@
[[self view] addSubview:[detailsContainer_ view]];
}
+- (NSSize)preferredSize {
+ // The buttons never change size, so rely on container.
+ NSSize buttonSize = [buttonContainer_ frame].size;
+ NSSize detailsSize = [detailsContainer_ preferredSize];
+
+ NSSize size = NSMakeSize(std::max(buttonSize.width, detailsSize.width),
+ buttonSize.height + detailsSize.height);
+
+ return size;
+}
+
+- (void)performLayout {
+ // Assume that the frame for the container is set already.
+ [detailsContainer_ performLayout];
+}
+
- (void)buildWindowButtonsForFrame:(NSRect)frame {
if (buttonContainer_.get())
return;

Powered by Google App Engine
This is Rietveld 408576698