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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_util.cc
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 74c970f631ac85b13238c3bb52e1a8e537617d2c..b4c2a4d398fb8c65fd984ff535f3f081f4c4d321 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -100,6 +100,13 @@ void RestoreWindow(aura::Window* window) {
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
}
+void ToggleMaximizedWindow(aura::Window* window) {
+ if (ash::wm::IsWindowMaximized(window))
+ ash::wm::RestoreWindow(window);
+ else if (ash::wm::CanMaximizeWindow(window))
+ ash::wm::MaximizeWindow(window);
+}
+
void CenterWindow(aura::Window* window) {
const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window);
gfx::Rect center = display.work_area().Center(window->bounds().size());
« 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