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..ab28b9953adf8b9bf6c9004791a611633ac10e6a 100644 |
| --- a/ash/accelerators/accelerator_controller.cc |
| +++ b/ash/accelerators/accelerator_controller.cc |
| @@ -649,20 +649,25 @@ bool AcceleratorController::PerformAction(int action, |
| } |
| break; |
| } |
| - case WINDOW_MAXIMIZE_RESTORE: { |
| + case TOGGLE_MAXIMIZED: { |
| + 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 |
|
sky
2012/09/16 16:08:03
Change that last sentence to 'Return false so Chro
sschmitz
2012/09/17 15:22:05
Done.
|
| + // 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(); |