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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10914231: Map fullscreen button to maximize (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix for review issues 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.cc » ('j') | ash/wm/window_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 2b9eaa5a15dab8c6313e52455074a5b874e1b760..2a04f531b29c23bef21e4f3632ad224a798c4562 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -650,18 +650,20 @@ bool AcceleratorController::PerformAction(int action,
break;
}
case WINDOW_MAXIMIZE_RESTORE: {
+ if (key_code == ui::VKEY_F4 && shell->delegate())
+ shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_MAXIMIZE_RESTORE);
aura::Window* window = wm::GetActiveWindow();
- // Attempt to restore the window that would be cycled through next from
- // the launcher when there is no active window.
if (!window)
- return HandleCycleWindowMRU(WindowCycleController::FORWARD, false);
- if (!wm::IsWindowFullscreen(window)) {
- if (wm::IsWindowMaximized(window))
- wm::RestoreWindow(window);
- else
- wm::MaximizeWindow(window);
return true;
+ if (wm::IsWindowFullscreen(window)) {
+ if (shell->delegate())
+ shell->delegate()->ToggleFullscreenMode();
+ } else if (wm::IsWindowMaximized(window)) {
+ wm::RestoreWindow(window);
+ } else if (wm::CanMaximizeWindow(window)) {
+ wm::MaximizeWindow(window);
}
+ return true;
break;
sky 2012/09/13 00:46:22 no break.
sschmitz 2012/09/13 19:34:13 Done.
}
case WINDOW_POSITION_CENTER: {
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.cc » ('j') | ash/wm/window_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698