Chromium Code Reviews| Index: views/widget/widget_win.cc |
| =================================================================== |
| --- views/widget/widget_win.cc (revision 29817) |
| +++ views/widget/widget_win.cc (working copy) |
| @@ -137,6 +137,15 @@ |
| SWP_NOACTIVATE | SWP_NOZORDER); |
| } |
| +void WidgetWin::MoveAbove(Widget* widget) { |
| + WidgetWin* other = static_cast<WidgetWin*>(widget); |
|
Ben Goodger (Google)
2009/10/26 18:10:13
How about just other->GetNativeView()... then you
|
| + gfx::Rect bounds; |
| + GetBounds(&bounds, false); |
| + SetWindowPos(other->hwnd(), bounds.x(), bounds.y(), |
| + bounds.width(), bounds.height(), |
| + SWP_NOACTIVATE); |
| +} |
| + |
| void WidgetWin::SetShape(const gfx::Path& shape) { |
| SetWindowRgn(shape.CreateHRGN(), TRUE); |
| } |
| @@ -252,6 +261,13 @@ |
| layered_alpha_ = static_cast<BYTE>(opacity); |
| } |
| +void WidgetWin::SetAlwaysOnTop(bool on_top) { |
| + if (on_top) |
| + set_window_ex_style(window_ex_style() | WS_EX_TOPMOST); |
| + else |
| + set_window_ex_style(window_ex_style() & ~WS_EX_TOPMOST); |
| +} |
| + |
| RootView* WidgetWin::GetRootView() { |
| if (!root_view_.get()) { |
| // First time the root view is being asked for, create it now. |
| @@ -1150,13 +1166,18 @@ |
| // Widget, public: |
| // static |
| -Widget* Widget::CreateTransparentPopupWidget(bool delete_on_destroy) { |
| +Widget* Widget::CreatePopupWidget(TransparencyParam transparent, |
| + EventsParam accept_events, |
| + DeleteParam delete_on_destroy) { |
| WidgetWin* popup = new WidgetWin; |
| + DWORD ex_style = WS_EX_TOOLWINDOW | l10n_util::GetExtendedTooltipStyles(); |
| + if (transparent == Transparent) |
| + ex_style |= WS_EX_LAYERED; |
| + if (accept_events != AcceptEvents) |
| + ex_style |= WS_EX_TRANSPARENT; |
| popup->set_window_style(WS_POPUP); |
| - popup->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | |
| - WS_EX_TRANSPARENT | |
| - l10n_util::GetExtendedTooltipStyles()); |
| - popup->set_delete_on_destroy(delete_on_destroy); |
| + popup->set_window_ex_style(ex_style); |
| + popup->set_delete_on_destroy(delete_on_destroy == DeleteOnDestroy); |
| return popup; |
| } |