Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Unified Diff: views/widget/widget_win.cc

Issue 307030: New widget factories & methods to support desktop notifications, GTK stubs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/widget_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « views/widget/widget_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698