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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/window_util.h" 5 #include "ash/wm/window_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/activation_controller.h" 10 #include "ash/wm/activation_controller.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 std::vector<ui::Layer*> children = layer->children(); 125 std::vector<ui::Layer*> children = layer->children();
126 for (std::vector<ui::Layer*>::const_iterator it = children.begin(); 126 for (std::vector<ui::Layer*>::const_iterator it = children.begin();
127 it != children.end(); 127 it != children.end();
128 ++it) { 128 ++it) {
129 ui::Layer* child = *it; 129 ui::Layer* child = *it;
130 DeepDeleteLayers(child); 130 DeepDeleteLayers(child);
131 } 131 }
132 delete layer; 132 delete layer;
133 } 133 }
134 134
135 void ToggleMaximizedState(aura::Window* window) {
136 if (GetRestoreBoundsInScreen(window)) {
137 if (IsWindowNormal(window)) {
138 // The only way this can happen is that we are in left/right maximized
139 // state and need to really maximize.
140 gfx::Rect restore_bounds = *GetRestoreBoundsInScreen(window);
141 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
142 ui::SHOW_STATE_MAXIMIZED);
143 SetRestoreBoundsInScreen(window, restore_bounds);
144 } else {
145 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
146 }
147 } else {
148 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
149 }
150 }
151
135 } // namespace wm 152 } // namespace wm
136 } // namespace ash 153 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698