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

Unified Diff: views/widget/native_widget_win.cc

Issue 7358005: Makes sure widget is created at right size before showing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 9 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
Index: views/widget/native_widget_win.cc
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc
index 6d6f141a5ccf2c36a8b06cd0353ff2a923f04ca9..914afaa55fdfe46928097e3465e619a5f7040592 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -894,7 +894,16 @@ void NativeWidgetWin::Hide() {
}
}
-void NativeWidgetWin::ShowNativeWidget(ShowState state) {
+void NativeWidgetWin::ShowMaximizedWithBounds(
+ const gfx::Rect& restored_bounds) {
+ WINDOWPLACEMENT placement = { 0 };
+ placement.length = sizeof(WINDOWPLACEMENT);
+ placement.showCmd = SW_SHOWMAXIMIZED;
+ placement.rcNormalPosition = restored_bounds.ToRECT();
+ SetWindowPlacement(hwnd(), &placement);
+}
+
+void NativeWidgetWin::ShowWithState(ShowState state) {
DWORD native_show_state;
switch (state) {
case SHOW_INACTIVE:
@@ -2213,6 +2222,8 @@ void NativeWidgetWin::SetInitParams(const Widget::InitParams& params) {
// Set type-independent style attributes.
if (params.child)
style |= WS_CHILD | WS_VISIBLE;
+ if (params.maximize)
+ style |= WS_MAXIMIZE;
if (!params.accept_events)
ex_style |= WS_EX_TRANSPARENT;
if (!params.can_activate)
« no previous file with comments | « views/widget/native_widget_win.h ('k') | views/widget/widget.h » ('j') | views/widget/widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698