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

Unified Diff: views/widget/native_widget_win.cc

Issue 7790010: Revert 98679 - Restoring a session should restore window minimization state on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
===================================================================
--- views/widget/native_widget_win.cc (revision 98696)
+++ views/widget/native_widget_win.cc (working copy)
@@ -637,12 +637,11 @@
ui::CenterAndSizeWindow(parent, GetNativeView(), size, false);
}
-void NativeWidgetWin::GetWindowPlacement(
- gfx::Rect* bounds,
- ui::WindowShowState* show_state) const {
+void NativeWidgetWin::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds,
+ bool* maximized) const {
WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
- const bool succeeded = !!::GetWindowPlacement(GetNativeView(), &wp);
+ const bool succeeded = !!GetWindowPlacement(GetNativeView(), &wp);
DCHECK(succeeded);
if (bounds != NULL) {
@@ -657,14 +656,8 @@
mi.rcWork.top - mi.rcMonitor.top);
}
- if (show_state != NULL) {
- if (wp.showCmd == SW_SHOWMAXIMIZED)
- *show_state = ui::SHOW_STATE_MAXIMIZED;
- else if (wp.showCmd == SW_SHOWMINIMIZED)
- *show_state = ui::SHOW_STATE_MINIMIZED;
- else
- *show_state = ui::SHOW_STATE_NORMAL;
- }
+ if (maximized != NULL)
+ *maximized = (wp.showCmd == SW_SHOWMAXIMIZED);
}
void NativeWidgetWin::SetWindowTitle(const std::wstring& title) {
@@ -768,7 +761,7 @@
return gfx::Rect(saved_window_info_.window_rect);
gfx::Rect bounds;
- GetWindowPlacement(&bounds, NULL);
+ GetWindowBoundsAndMaximizedState(&bounds, NULL);
return bounds;
}
@@ -884,18 +877,15 @@
SetWindowPlacement(hwnd(), &placement);
}
-void NativeWidgetWin::ShowWithWindowState(ui::WindowShowState show_state) {
+void NativeWidgetWin::ShowWithState(ShowState state) {
DWORD native_show_state;
- switch (show_state) {
- case ui::SHOW_STATE_INACTIVE:
+ switch (state) {
+ case SHOW_INACTIVE:
native_show_state = SW_SHOWNOACTIVATE;
break;
- case ui::SHOW_STATE_MAXIMIZED:
+ case SHOW_MAXIMIZED:
native_show_state = SW_SHOWMAXIMIZED;
break;
- case ui::SHOW_STATE_MINIMIZED:
- native_show_state = SW_SHOWMINIMIZED;
- break;
default:
native_show_state = GetShowState();
break;
@@ -2186,10 +2176,8 @@
// Set type-independent style attributes.
if (params.child)
style |= WS_CHILD | WS_VISIBLE;
- if (params.show_state == ui::SHOW_STATE_MAXIMIZED)
+ if (params.maximize)
style |= WS_MAXIMIZE;
- if (params.show_state == ui::SHOW_STATE_MINIMIZED)
- style |= WS_MINIMIZE;
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