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) |