| Index: ash/accelerators/accelerator_controller.cc
|
| diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
|
| index 2b9eaa5a15dab8c6313e52455074a5b874e1b760..098e4236e1a8a603fc037c5349abcf72511c89e1 100644
|
| --- a/ash/accelerators/accelerator_controller.cc
|
| +++ b/ash/accelerators/accelerator_controller.cc
|
| @@ -650,19 +650,24 @@ 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_F4);
|
| + }
|
| 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)) {
|
| + // Chrome also uses VKEY_F4 as a shortcut. Its action is to toggle
|
| + // fullscreen. If we got here via VKEY_F4, chrome's action will
|
| + // execute next and fullscreen will be toggled off.
|
| + return false;
|
| }
|
| - break;
|
| + if (wm::IsWindowMaximized(window))
|
| + wm::RestoreWindow(window);
|
| + else if (wm::CanMaximizeWindow(window))
|
| + wm::MaximizeWindow(window);
|
| + return true;
|
| }
|
| case WINDOW_POSITION_CENTER: {
|
| aura::Window* window = wm::GetActiveWindow();
|
|
|