Commit 7dbdba5d authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

views: implement NativeWidgetMac::StackAbove

This change implements StackAbove in MacViews. Whether StackAbove is "sticky" or not is undocumented
but it appears to be not sticky on Linux or Windows, which is fortunate since
non-sticky is the only implementable behavior on Mac.

Bug: 825937
Change-Id: Idaa4e90fd123b0d6c5bab60de3fb24417a488de1
Reviewed-on: https://chromium-review.googlesource.com/986552Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549301}
parent 294b742e
......@@ -47,8 +47,13 @@ Widget* CreateBubbleWidget(BubbleDialogDelegateView* bubble) {
: Widget::InitParams::ACTIVATABLE_NO;
bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget);
bubble_widget->Init(bubble_params);
#if !defined(OS_MACOSX)
// On Mac, having a parent window creates a permanent stacking order, so
// there's no need to do this. Also, calling StackAbove() on Mac shows the
// bubble implicitly, for which the bubble is currently not ready.
if (bubble_params.parent)
bubble_widget->StackAbove(bubble_params.parent);
#endif
return bubble_widget;
}
......
......@@ -339,11 +339,8 @@ void NativeWidgetMac::SetSize(const gfx::Size& size) {
}
void NativeWidgetMac::StackAbove(gfx::NativeView native_view) {
// NativeWidgetMac currently only has machinery for stacking windows, and only
// stacks child windows above parents. That's currently all this is used for.
// DCHECK if a new use case comes along.
DCHECK(bridge_ && bridge_->parent());
DCHECK_EQ([native_view window], bridge_->parent()->GetNSWindow());
NSInteger view_parent = native_view.window.windowNumber;
[GetNativeWindow() orderWindow:NSWindowAbove relativeTo:view_parent];
}
void NativeWidgetMac::StackAtTop() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment