From fa94127695795ba1b35953a88d829e4381e78e7b Mon Sep 17 00:00:00 2001 From: "jamescook@chromium.org" Date: Wed, 4 Sep 2013 23:31:33 +0000 Subject: ash: Allow web pages to use the Ctrl-M minimize shortcut The active window is minimized only if the active web page or app does not handle the key first. BUG=284522 TEST=manual, ash_unittests AcceleratorCommandsTest.* Review URL: https://chromiumcodereview.appspot.com/23611005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221294 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/browser_command_controller.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'chrome/browser/ui/browser_command_controller.cc') diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 07e1822..b91d63f 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -51,6 +51,7 @@ #endif #if defined(USE_ASH) +#include "ash/accelerators/accelerator_commands.h" #include "chrome/browser/ui/ash/ash_util.h" #endif @@ -444,6 +445,11 @@ void BrowserCommandController::ExecuteCommandWithDisposition( case IDC_TOGGLE_ASH_DESKTOP: chrome::ToggleAshDesktop(); break; + case IDC_MINIMIZE_WINDOW: + ash::accelerators::ToggleMinimized(); + break; + // If Ash needs many more commands here we should implement a general + // mechanism to pass accelerators back into Ash. http://crbug.com/285308 #endif #if defined(OS_WIN) @@ -836,6 +842,9 @@ void BrowserCommandController::InitCommandState() { chrome::HOST_DESKTOP_TYPE_NATIVE != chrome::HOST_DESKTOP_TYPE_ASH) command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true); #endif +#if defined(USE_ASH) + command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); +#endif // Page-related commands command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); -- cgit v1.1