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

Unified Diff: views/widget/widget_win.cc

Issue 160474: Status bubble limping in TOOLKIT_VIEWS.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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') | views/window/window_gtk.cc » ('j') | 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 22173)
+++ views/widget/widget_win.cc (working copy)
@@ -6,13 +6,13 @@
#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
+#include "app/l10n_util_win.h"
#include "app/win_util.h"
#include "base/gfx/native_theme.h"
#include "base/string_util.h"
#include "base/win_util.h"
#include "views/accessibility/view_accessibility.h"
#include "views/controls/native_control_win.h"
-#include "views/fill_layout.h"
#include "views/focus/focus_util_win.h"
#include "views/views_delegate.h"
#include "views/widget/aero_tooltip_manager.h"
@@ -154,7 +154,10 @@
MessageLoopForUI::current()->RemoveObserver(this);
}
-void WidgetWin::Init(HWND parent, const gfx::Rect& bounds) {
+///////////////////////////////////////////////////////////////////////////////
+// Widget implementation:
+
+void WidgetWin::Init(gfx::NativeView parent, const gfx::Rect& bounds) {
if (window_style_ == 0)
window_style_ = parent ? kWindowDefaultChildStyle : kWindowDefaultStyle;
@@ -218,24 +221,9 @@
}
void WidgetWin::SetContentsView(View* view) {
- DCHECK(view && hwnd_) << "Can't be called until after the HWND is created!";
- // The ContentsView must be set up _after_ the window is created so that its
- // Widget pointer is valid.
- root_view_->SetLayoutManager(new FillLayout);
- if (root_view_->GetChildViewCount() != 0)
- root_view_->RemoveAllChildViews(true);
- root_view_->AddChildView(view);
-
- // Force a layout now, since the attached hierarchy won't be ready for the
- // containing window's bounds. Note that we call Layout directly rather than
- // calling ChangeSize, since the RootView's bounds may not have changed, which
- // will cause the Layout not to be done otherwise.
- root_view_->Layout();
+ root_view_->SetContentsView(view);
}
-///////////////////////////////////////////////////////////////////////////////
-// Widget implementation:
-
void WidgetWin::GetBounds(gfx::Rect* out, bool including_frame) const {
CRect crect;
if (including_frame) {
@@ -1088,4 +1076,20 @@
widget->focus_manager_->RestoreFocusedView();
}
}
+
+////////////////////////////////////////////////////////////////////////////////
+// Widget, public:
+
+// static
+Widget* Widget::CreateTransparentPopupWidget(bool delete_on_destroy) {
+ WidgetWin* popup = new WidgetWin;
+ 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);
+ return popup;
+}
+
} // namespace views
+
« no previous file with comments | « views/widget/widget_win.h ('k') | views/window/window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698