summaryrefslogtreecommitdiffstats
path: root/views/window
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-31 15:33:01 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-31 15:33:01 +0000
commitcc8243726aa110ed22194e7ebde5ea69430b6ab4 (patch)
tree455cce5da51deeb47c962ea7c2cb62331e896973 /views/window
parent3c5f059a2881b0d990e49cbc2b1e5a3dd4e9df7f (diff)
downloadchromium_src-cc8243726aa110ed22194e7ebde5ea69430b6ab4.zip
chromium_src-cc8243726aa110ed22194e7ebde5ea69430b6ab4.tar.gz
chromium_src-cc8243726aa110ed22194e7ebde5ea69430b6ab4.tar.bz2
Keyboard accessibility for the page and app menus.
Works on Windows, and on Linux with toolkit_views. The goal is to make Chrome behave more like a standard Windows application, for users who rely on the keyboard and expect standard keyboard accelerators to work. Pressing F10, or pressing and releasing Alt, will set focus to the Page menu, as if it was the first item in a menu bar. Pressing enter, space, up arrow, or down arrow will open the focused menu. Once a menu is opened, pressing left and right arrows will switch between the two menus. Pressing escape will return focus to the title of the previously open menu. A new UI test attempts to select something from the menus using only the keyboard. It works on Linux (with toolkit_views) and on Windows. BUG=none TEST=New keyboard accessibility interactive ui test. Review URL: http://codereview.chromium.org/660323 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43216 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window')
-rw-r--r--views/window/window_win.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/views/window/window_win.cc b/views/window/window_win.cc
index 4013523d9..18857fa 100644
--- a/views/window/window_win.cc
+++ b/views/window/window_win.cc
@@ -1086,6 +1086,15 @@ void WindowWin::OnSysCommand(UINT notification_code, CPoint click) {
}
}
+ // Handle SC_KEYMENU, which means that the user has pressed the ALT
+ // key and released it, so we should focus the menu bar.
+ if ((notification_code & sc_mask) == SC_KEYMENU && click.x == 0) {
+ Accelerator accelerator(win_util::WinToKeyboardCode(VK_MENU),
+ false, false, false);
+ GetFocusManager()->ProcessAccelerator(accelerator);
+ return;
+ }
+
// First see if the delegate can handle it.
if (window_delegate_->ExecuteWindowsCommand(notification_code))
return;