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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_window_controller.mm

Issue 2738623002: [Mac] Turn on Auto Layout for browser windows. (Closed)
Patch Set: Nits. Created 3 years, 9 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
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
index cd5a115b3e2e659be0e41cbee73634072d5a7d60..716cb70c975cf3dc0740bb3958365f211f1b17d3 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
@@ -63,6 +63,24 @@
@end
+// Subview of the window's contentView, contains everything but the tab strip.
+@interface ChromeContentView : NSView
+@end
+
+@implementation ChromeContentView
+
+// NSView overrides.
+
+// Since Auto Layout and frame-based layout behave differently in small but
+// important ways (e.g. Auto Layout can restrict window resizing, frame-based
+// layout doesn't log a warning when a view's autoresizing mask can't be
+// maintained), ensure that it's on instead of letting it depend on content.
++ (BOOL)requiresConstraintBasedLayout {
+ return YES;
+}
+
+@end
+
@implementation TabWindowController
- (id)initTabWindowControllerWithTabStrip:(BOOL)hasTabStrip
@@ -80,7 +98,7 @@
if ((self = [super initWithWindow:window])) {
[[self window] setDelegate:self];
- chromeContentView_.reset([[NSView alloc]
+ chromeContentView_.reset([[ChromeContentView alloc]
initWithFrame:NSMakeRect(0, 0, kDefaultWidth, kDefaultHeight)]);
[chromeContentView_
setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698