Remove the duplicate logic on OS X

This commit is contained in:
Cheng Zhao 2016-03-05 21:54:41 +09:00
parent 2be368bded
commit 114801d412
2 changed files with 7 additions and 18 deletions

View file

@ -133,18 +133,17 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
if (options.Get(options::kAlwaysOnTop, &top) && top) {
SetAlwaysOnTop(true);
}
// Disable fullscreen button when 'fullscreenable' is false or 'fullscreen'
// is specified to false.
// Disable fullscreen button if 'fullscreen' is specified to false.
bool fullscreenable = true;
options.Get(options::kFullScreenable, &fullscreenable);
bool fullscreen = false;
if (options.Get(options::kFullscreen, &fullscreen) && !fullscreen)
fullscreenable = false;
// Overriden by 'fullscreenable'.
options.Get(options::kFullScreenable, &fullscreenable);
SetFullScreenable(fullscreenable);
if (fullscreen)
if (fullscreen) {
SetFullScreen(true);
}
bool skip;
if (options.Get(options::kSkipTaskbar, &skip) && skip) {
SetSkipTaskbar(skip);

View file

@ -482,19 +482,9 @@ NativeWindowMac::NativeWindowMac(
options.Get(options::kDisableAutoHideCursor, &disableAutoHideCursor);
[window_ setDisableAutoHideCursor:disableAutoHideCursor];
// Disable fullscreen button when 'fullscreenable' is false or 'fullscreen'
// is specified to false.
bool fullscreenable = true;
options.Get(options::kFullScreenable, &fullscreenable);
bool fullscreen = false;
if (options.Get(options::kFullscreen, &fullscreen) && !fullscreen)
fullscreenable = false;
SetFullScreenable(fullscreenable);
// Disable zoom button if window is not resizable
if (!maximizable) {
// Disable zoom button if window is not resizable.
if (!maximizable)
SetMaximizable(false);
}
NSView* view = inspectable_web_contents()->GetView()->GetNativeView();
[view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];