mac: Add win.setParentWindow(parent) API

This commit is contained in:
Cheng Zhao 2016-06-17 15:28:43 +09:00
parent e4d30ccfc3
commit fd42e3dc84
7 changed files with 22 additions and 0 deletions

View file

@ -911,6 +911,16 @@ bool NativeWindowMac::HasModalDialog() {
return [window_ attachedSheet] != nil;
}
void NativeWindowMac::SetParentWindow(NativeWindow* parent) {
// Remove current parent window.
if ([window_ parentWindow])
[[window_ parentWindow] removeChildWindow:window_];
// Set new current window.
if (parent)
[parent->GetNativeWindow() addChildWindow:window_ ordered:NSWindowAbove];
}
gfx::NativeWindow NativeWindowMac::GetNativeWindow() {
return window_;
}