summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/native_menu_gtk.h
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 17:39:35 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 17:39:35 +0000
commit9201662e1c9ce2c9afae43c2e6c74c673f7aed17 (patch)
treecc73c6141a81f9202ef14e83605d1b2f614e7217 /views/controls/menu/native_menu_gtk.h
parentc6cd2dbcec52a90b3a97e931a36757151f23b6ed (diff)
downloadchromium_src-9201662e1c9ce2c9afae43c2e6c74c673f7aed17.zip
chromium_src-9201662e1c9ce2c9afae43c2e6c74c673f7aed17.tar.gz
chromium_src-9201662e1c9ce2c9afae43c2e6c74c673f7aed17.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@42234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/native_menu_gtk.h')
-rw-r--r--views/controls/menu/native_menu_gtk.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/views/controls/menu/native_menu_gtk.h b/views/controls/menu/native_menu_gtk.h
index 2c69ba3..2ea0c84c 100644
--- a/views/controls/menu/native_menu_gtk.h
+++ b/views/controls/menu/native_menu_gtk.h
@@ -1,6 +1,6 @@
-// Copyright (c) 2009 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_NATIVE_MENU_GTK_H_
#define VIEWS_CONTROLS_MENU_NATIVE_MENU_GTK_H_
@@ -36,9 +36,13 @@ class NativeMenuGtk : public MenuWrapper {
virtual void Rebuild();
virtual void UpdateStates();
virtual gfx::NativeMenu GetNativeMenu() const;
+ virtual MenuAction GetMenuAction() const;
private:
static void OnMenuHidden(GtkWidget* widget, NativeMenuGtk* menu);
+ static void OnMenuMoveCurrent(GtkMenu* widget,
+ GtkMenuDirectionType focus_direction,
+ NativeMenuGtk* menu);
void AddSeparatorAt(int index);
GtkWidget* AddMenuItemAt(int index, GtkRadioMenuItem* radio_group,
@@ -111,6 +115,9 @@ class NativeMenuGtk : public MenuWrapper {
Menu2* host_menu_;
gulong destroy_handler_id_;
+ // The action that took place during the call to RunMenuAt.
+ MenuAction menu_action_;
+
DISALLOW_COPY_AND_ASSIGN(NativeMenuGtk);
};