Set maximizable state after installing view

This commit is contained in:
Kevin Sawicki 2016-06-08 13:56:45 -07:00
parent f4c1cd11a0
commit 9f93f4e27f

View file

@ -524,10 +524,6 @@ NativeWindowMac::NativeWindowMac(
options.Get(options::kDisableAutoHideCursor, &disableAutoHideCursor); options.Get(options::kDisableAutoHideCursor, &disableAutoHideCursor);
[window_ setDisableAutoHideCursor:disableAutoHideCursor]; [window_ setDisableAutoHideCursor:disableAutoHideCursor];
// Disable zoom button if window is not resizable.
if (!maximizable)
SetMaximizable(false);
NSView* view = inspectable_web_contents()->GetView()->GetNativeView(); NSView* view = inspectable_web_contents()->GetView()->GetNativeView();
[view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
@ -555,6 +551,12 @@ NativeWindowMac::NativeWindowMac(
}]; }];
InstallView(); InstallView();
// Disable zoom button if window is not resizable.
// Set maximizable state last to ensure zoom button does not get reset
// by calls to other APIs.
if (!maximizable)
SetMaximizable(false);
} }
NativeWindowMac::~NativeWindowMac() { NativeWindowMac::~NativeWindowMac() {