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

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: 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
« no previous file with comments | « views/widget/native_widget_win.h ('k') | views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_win.cc
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc
index 8d2420ea986206d35a5f56a0e08b1e18084fbd71..0bc65efcabf968d8c004b1dd368cbece0cc59fa2 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -882,6 +882,14 @@ void NativeWidgetWin::Hide() {
}
}
+void NativeWidgetWin::ShowMaximized(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::ShowNativeWidget(ShowState state) {
Ben Goodger (Google) 2011/07/13 23:53:40 OK let's normalize these names. Show()->Show() Sh
DWORD native_show_state;
switch (state) {
@@ -2187,6 +2195,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698