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

Unified Diff: ash/wm/window_util.cc

Issue 10883069: Added restore functionality for maximize full/left/right (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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

Powered by Google App Engine
This is Rietveld 408576698