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

Unified Diff: views/window/window_win.cc

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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/window/window_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/window_win.cc
===================================================================
--- views/window/window_win.cc (revision 83020)
+++ views/window/window_win.cc (working copy)
@@ -242,10 +242,12 @@
Window* Window::CreateChromeWindow(gfx::NativeWindow parent,
const gfx::Rect& bounds,
WindowDelegate* window_delegate) {
- WindowWin* window = new WindowWin(window_delegate);
- window->GetWindow()->non_client_view()->SetFrameView(
- window->CreateFrameViewForWindow());
- window->Init(parent, bounds);
+ Window* window = new WindowWin(window_delegate);
+ window->non_client_view()->SetFrameView(window->CreateFrameViewForWindow());
+ Widget::CreateParams params(Widget::WindowCreateParams());
+ params.parent = parent;
+ params.bounds = bounds;
+ window->AsWidget()->Init(params);
return window;
}
@@ -321,20 +323,6 @@
set_window_ex_style(0);
}
-void WindowWin::Init(gfx::NativeView parent, const gfx::Rect& bounds) {
- if (window_style() == 0)
- set_window_style(CalculateWindowStyle());
- if (window_ex_style() == 0)
- set_window_ex_style(CalculateWindowExStyle());
-
- GetMonitorAndRects(bounds.ToRECT(), &last_monitor_, &last_monitor_rect_,
- &last_work_area_);
-
- WidgetWin::Init(parent, bounds);
-
- delegate_->OnNativeWindowCreated(bounds);
-}
-
gfx::Insets WindowWin::GetClientAreaInsets() const {
// Returning an empty Insets object causes the default handling in
// WidgetWin::OnNCCalcSize() to be invoked.
@@ -369,6 +357,20 @@
///////////////////////////////////////////////////////////////////////////////
// WindowWin, WidgetWin overrides:
+void WindowWin::InitNativeWidget(const Widget::CreateParams& params) {
+ if (window_style() == 0)
+ set_window_style(CalculateWindowStyle());
+ if (window_ex_style() == 0)
+ set_window_ex_style(CalculateWindowExStyle());
+
+ GetMonitorAndRects(params.bounds.ToRECT(), &last_monitor_,
+ &last_monitor_rect_, &last_work_area_);
+
+ WidgetWin::InitNativeWidget(params);
+
+ delegate_->OnNativeWindowCreated(params.bounds);
+}
+
void WindowWin::OnActivateApp(BOOL active, DWORD thread_id) {
if (!active && thread_id != GetCurrentThreadId()) {
// Another application was activated, we should reset any state that
« no previous file with comments | « views/window/window_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698