summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/menu_2.h
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 15:29:20 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 15:29:20 +0000
commited256c7bd9828576ce865926e898a6c592b14037 (patch)
tree598f0023ad717aa23953cd4bcb666fc2df1410f6 /views/controls/menu/menu_2.h
parentb4fe9eb3acfd443091ebecbbbd1f87247cce9e1d (diff)
downloadchromium_src-ed256c7bd9828576ce865926e898a6c592b14037.zip
chromium_src-ed256c7bd9828576ce865926e898a6c592b14037.tar.gz
chromium_src-ed256c7bd9828576ce865926e898a6c592b14037.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 ui test. Review URL: http://codereview.chromium.org/660323 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42217 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/menu_2.h')
-rw-r--r--views/controls/menu/menu_2.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/views/controls/menu/menu_2.h b/views/controls/menu/menu_2.h
index 77ff3d0..adb1c0f 100644
--- a/views/controls/menu/menu_2.h
+++ b/views/controls/menu/menu_2.h
@@ -1,6 +1,6 @@
-// Copyright (c) 2010 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.
+// Copyright (c) 2010 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.
#ifndef VIEWS_CONTROLS_MENU_MENU_2_H_
#define VIEWS_CONTROLS_MENU_MENU_2_H_
@@ -61,6 +61,11 @@ class Menu2 {
// For submenus.
gfx::NativeMenu GetNativeMenu() const;
+ // Get the result of the last call to RunMenuAt to determine whether an
+ // item was selected, the user navigated to a next or previous menu, or
+ // nothing.
+ MenuWrapper::MenuAction GetMenuAction() const;
+
// Accessors.
menus::MenuModel* model() const { return model_; }
@@ -78,4 +83,3 @@ class Menu2 {
} // namespace views
#endif // VIEWS_CONTROLS_MENU_MENU_2_H_
-