Chromium Code Reviews| Index: views/widget/native_widget_aura.cc |
| diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc |
| index cb4eebafab360b2eb12f222ff2297c5b1f98a8f6..b7e2f456dc4eb9e0ff2d601e89c2363919f03311 100644 |
| --- a/views/widget/native_widget_aura.cc |
| +++ b/views/widget/native_widget_aura.cc |
| @@ -144,6 +144,9 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { |
| gfx::NativeView parent = params.GetParent(); |
| if (parent) |
| parent->AddTransientChild(window_); |
| + // SetAlwaysOnTop before SetParent so that always-on-top container is used. |
| + if (params.keep_on_top) |
| + SetAlwaysOnTop(true); |
|
oshima
2011/11/08 23:34:24
SetAlwaysOnTop(params.keep_on_top);
xiyuan
2011/11/09 17:42:18
Done.
|
| window_->SetParent(NULL); |
| } |
| // TODO(beng): do this some other way. |
| @@ -418,8 +421,22 @@ bool NativeWidgetAura::IsActive() const { |
| } |
| void NativeWidgetAura::SetAlwaysOnTop(bool on_top) { |
| - // http://crbug.com/102582 |
| - NOTIMPLEMENTED(); |
| + switch (window_->type()) { |
|
oshima
2011/11/08 23:34:24
I think we want the shell handle these cases, not
xiyuan
2011/11/09 17:42:18
Code is removed. Set always-on-top property on men
|
| + case aura::WINDOW_TYPE_NORMAL: |
| + case aura::WINDOW_TYPE_POPUP: |
| + SetNativeWindowProperty(aura::kAlwaysOnTopKey, |
| + reinterpret_cast<void*>(on_top)); |
|
oshima
2011/11/08 23:34:24
window->SetIntProperty(aura::kAlwaysOnTopKey, on_t
xiyuan
2011/11/09 17:42:18
Done.
|
| + break; |
| + case aura::WINDOW_TYPE_MENU: |
| + case aura::WINDOW_TYPE_TOOLTIP: |
| + // Menu and tooptip has their own container and ignores always-on-top. |
| + break; |
| + default: |
| + NOTREACHED() << "Window " << window_->id() |
| + << " of type " << window_->type() |
| + << " does not support always-on-top."; |
| + break; |
| + } |
| } |
| void NativeWidgetAura::Maximize() { |