Chromium Code Reviews| Index: ash/wm/window_util.cc |
| diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc |
| index b3a8b3648440aacbae9e39145f5d1af08931c537..1243c4eeba2a1f91608affbbf243b96aa3249625 100644 |
| --- a/ash/wm/window_util.cc |
| +++ b/ash/wm/window_util.cc |
| @@ -132,5 +132,22 @@ void DeepDeleteLayers(ui::Layer* layer) { |
| delete layer; |
| } |
| +void ToggleMaximizedState(aura::Window* window) { |
| + if (GetRestoreBoundsInScreen(window)) { |
| + if (IsWindowNormal(window)) { |
| + // The only way this can happen is that we are in left/right maximized |
| + // state and need to really maximize. |
| + gfx::Rect restore_bounds = *GetRestoreBoundsInScreen(window); |
| + window->SetProperty(aura::client::kShowStateKey, |
|
sky
2012/08/28 20:46:36
Don't maximize here, just set the bounds.
Mr4D (OOO till 08-26)
2012/08/28 22:40:02
No - that would not work. The left/right snapped m
|
| + ui::SHOW_STATE_MAXIMIZED); |
| + SetRestoreBoundsInScreen(window, restore_bounds); |
| + } else { |
| + window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| + } |
| + } else { |
| + window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| + } |
| +} |
| + |
| } // namespace wm |
| } // namespace ash |