Chromium Code Reviews| 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: { |