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

Side by Side Diff: ash/wm/window_util.cc

Issue 11082002: Remove TOGGLE_MAXIMIZED_* from Ash reserved actions list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add ash::wm::ToggleMaximizedWindow to window_util.h Created 8 years, 2 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
« no previous file with comments | « ash/wm/window_util.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 void MinimizeWindow(aura::Window* window) { 95 void MinimizeWindow(aura::Window* window) {
96 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); 96 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
97 } 97 }
98 98
99 void RestoreWindow(aura::Window* window) { 99 void RestoreWindow(aura::Window* window) {
100 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); 100 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
101 } 101 }
102 102
103 void ToggleMaximizedWindow(aura::Window* window) {
104 if (ash::wm::IsWindowMaximized(window))
105 ash::wm::RestoreWindow(window);
106 else if (ash::wm::CanMaximizeWindow(window))
107 ash::wm::MaximizeWindow(window);
108 }
109
103 void CenterWindow(aura::Window* window) { 110 void CenterWindow(aura::Window* window) {
104 const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window); 111 const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window);
105 gfx::Rect center = display.work_area().Center(window->bounds().size()); 112 gfx::Rect center = display.work_area().Center(window->bounds().size());
106 window->SetBounds(center); 113 window->SetBounds(center);
107 } 114 }
108 115
109 ui::Layer* RecreateWindowLayers(aura::Window* window, bool set_bounds) { 116 ui::Layer* RecreateWindowLayers(aura::Window* window, bool set_bounds) {
110 const gfx::Rect bounds = window->bounds(); 117 const gfx::Rect bounds = window->bounds();
111 ui::Layer* old_layer = window->RecreateLayer(); 118 ui::Layer* old_layer = window->RecreateLayer();
112 DCHECK(old_layer); 119 DCHECK(old_layer);
(...skipping 14 matching lines...) Expand all
127 it != children.end(); 134 it != children.end();
128 ++it) { 135 ++it) {
129 ui::Layer* child = *it; 136 ui::Layer* child = *it;
130 DeepDeleteLayers(child); 137 DeepDeleteLayers(child);
131 } 138 }
132 delete layer; 139 delete layer;
133 } 140 }
134 141
135 } // namespace wm 142 } // namespace wm
136 } // namespace ash 143 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_util.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698