|
@@ -347,7 +347,8 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
|
|
|
params.type = views::Widget::InitParams::TYPE_WINDOW;
|
|
|
params.native_widget = new AtomNativeWidgetMac(this, styleMask, widget());
|
|
|
widget()->Init(params);
|
|
|
- window_ = static_cast<AtomNSWindow*>(widget()->GetNativeWindow());
|
|
|
+ window_ = static_cast<AtomNSWindow*>(
|
|
|
+ widget()->GetNativeWindow().GetNativeNSWindow());
|
|
|
|
|
|
[window_ setEnableLargerThanScreen:enable_larger_than_screen()];
|
|
|
|
|
@@ -497,7 +498,7 @@ void NativeWindowMac::SetContentView(views::View* view) {
|
|
|
void NativeWindowMac::Close() {
|
|
|
// When this is a sheet showing, performClose won't work.
|
|
|
if (is_modal() && parent() && IsVisible()) {
|
|
|
- [parent()->GetNativeWindow() endSheet:window_];
|
|
|
+ [parent()->GetNativeWindow().GetNativeNSWindow() endSheet:window_];
|
|
|
CloseImmediately();
|
|
|
return;
|
|
|
}
|
|
@@ -545,9 +546,10 @@ bool NativeWindowMac::IsFocused() {
|
|
|
void NativeWindowMac::Show() {
|
|
|
if (is_modal() && parent()) {
|
|
|
if ([window_ sheetParent] == nil)
|
|
|
- [parent()->GetNativeWindow() beginSheet:window_
|
|
|
- completionHandler:^(NSModalResponse){
|
|
|
- }];
|
|
|
+ [parent()->GetNativeWindow().GetNativeNSWindow()
|
|
|
+ beginSheet:window_
|
|
|
+ completionHandler:^(NSModalResponse){
|
|
|
+ }];
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -573,7 +575,7 @@ void NativeWindowMac::ShowInactive() {
|
|
|
void NativeWindowMac::Hide() {
|
|
|
if (is_modal() && parent()) {
|
|
|
[window_ orderOut:nil];
|
|
|
- [parent()->GetNativeWindow() endSheet:window_];
|
|
|
+ [parent()->GetNativeWindow().GetNativeNSWindow() endSheet:window_];
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -897,7 +899,7 @@ void NativeWindowMac::FlashFrame(bool flash) {
|
|
|
void NativeWindowMac::SetSkipTaskbar(bool skip) {}
|
|
|
|
|
|
void NativeWindowMac::SetSimpleFullScreen(bool simple_fullscreen) {
|
|
|
- NSWindow* window = GetNativeWindow();
|
|
|
+ NSWindow* window = GetNativeWindow().GetNativeNSWindow();
|
|
|
|
|
|
if (simple_fullscreen && !is_simple_fullscreen_) {
|
|
|
is_simple_fullscreen_ = true;
|
|
@@ -1079,7 +1081,8 @@ void NativeWindowMac::AddBrowserView(NativeBrowserView* view) {
|
|
|
}
|
|
|
|
|
|
add_browser_view(view);
|
|
|
- auto* native_view = view->GetInspectableWebContentsView()->GetNativeView();
|
|
|
+ auto* native_view =
|
|
|
+ view->GetInspectableWebContentsView()->GetNativeView().GetNativeNSView();
|
|
|
[[window_ contentView] addSubview:native_view
|
|
|
positioned:NSWindowAbove
|
|
|
relativeTo:nil];
|
|
@@ -1097,7 +1100,8 @@ void NativeWindowMac::RemoveBrowserView(NativeBrowserView* view) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- [view->GetInspectableWebContentsView()->GetNativeView() removeFromSuperview];
|
|
|
+ [view->GetInspectableWebContentsView()->GetNativeView().GetNativeNSView()
|
|
|
+ removeFromSuperview];
|
|
|
remove_browser_view(view);
|
|
|
|
|
|
[CATransaction commit];
|
|
@@ -1212,11 +1216,12 @@ void NativeWindowMac::ToggleTabBar() {
|
|
|
}
|
|
|
|
|
|
bool NativeWindowMac::AddTabbedWindow(NativeWindow* window) {
|
|
|
- if (window_ == window->GetNativeWindow()) {
|
|
|
+ if (window_ == window->GetNativeWindow().GetNativeNSWindow()) {
|
|
|
return false;
|
|
|
} else {
|
|
|
if (@available(macOS 10.12, *))
|
|
|
- [window_ addTabbedWindow:window->GetNativeWindow() ordered:NSWindowAbove];
|
|
|
+ [window_ addTabbedWindow:window->GetNativeWindow().GetNativeNSWindow()
|
|
|
+ ordered:NSWindowAbove];
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -1441,7 +1446,8 @@ void NativeWindowMac::InternalSetParentWindow(NativeWindow* parent,
|
|
|
NativeWindow::SetParentWindow(parent);
|
|
|
|
|
|
// Do not remove/add if we are already properly attached.
|
|
|
- if (attach && parent && [window_ parentWindow] == parent->GetNativeWindow())
|
|
|
+ if (attach && parent &&
|
|
|
+ [window_ parentWindow] == parent->GetNativeWindow().GetNativeNSWindow())
|
|
|
return;
|
|
|
|
|
|
// Remove current parent window.
|
|
@@ -1451,7 +1457,9 @@ void NativeWindowMac::InternalSetParentWindow(NativeWindow* parent,
|
|
|
// Set new parent window.
|
|
|
// Note that this method will force the window to become visible.
|
|
|
if (parent && attach)
|
|
|
- [parent->GetNativeWindow() addChildWindow:window_ ordered:NSWindowAbove];
|
|
|
+ [parent->GetNativeWindow().GetNativeNSWindow()
|
|
|
+ addChildWindow:window_
|
|
|
+ ordered:NSWindowAbove];
|
|
|
}
|
|
|
|
|
|
void NativeWindowMac::ShowWindowButton(NSWindowButton button) {
|