| Index: ash/accelerators/accelerator_commands.cc
|
| diff --git a/ash/accelerators/accelerator_commands.cc b/ash/accelerators/accelerator_commands.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..24b8a62b13e84fee0045b0a6860b80facde2ff8f
|
| --- /dev/null
|
| +++ b/ash/accelerators/accelerator_commands.cc
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ash/accelerators/accelerator_commands.h"
|
| +
|
| +#include "ash/shell.h"
|
| +#include "ash/shell_delegate.h"
|
| +#include "ash/wm/window_cycle_controller.h"
|
| +#include "ash/wm/window_util.h"
|
| +
|
| +namespace ash {
|
| +namespace accelerators {
|
| +
|
| +bool ToggleMinimized() {
|
| + 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) {
|
| + ash::Shell::GetInstance()->window_cycle_controller()->
|
| + HandleCycleWindow(WindowCycleController::FORWARD, false);
|
| + return true;
|
| + }
|
| + // Disable the shortcut for minimizing full screen window due to
|
| + // crbug.com/131709, which is a crashing issue related to minimizing
|
| + // full screen pepper window.
|
| + if (wm::IsWindowFullscreen(window) || !wm::CanMinimizeWindow(window))
|
| + return false;
|
| + ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(
|
| + ash::UMA_MINIMIZE_PER_KEY);
|
| + wm::MinimizeWindow(window);
|
| + return true;
|
| +}
|
| +
|
| +} // namespace accelerators
|
| +} // namespace ash
|
|
|