summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 18:55:15 +0000
committerdtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 18:55:15 +0000
commit0a2d3da9994ecd911670a9fd74733fb8a1cd0dd1 (patch)
treef48ca700840c6ec7a3beacdd39460b7d3aae8ce8
parentb426aeb54d6cac4a92300c74381dfdbd69736572 (diff)
downloadchromium_src-0a2d3da9994ecd911670a9fd74733fb8a1cd0dd1.zip
chromium_src-0a2d3da9994ecd911670a9fd74733fb8a1cd0dd1.tar.gz
chromium_src-0a2d3da9994ecd911670a9fd74733fb8a1cd0dd1.tar.bz2
Add some missing states for menu items. This allows AT's to know when a menu item has a submenu (HASPOPUP) and is checked (either a radio or checkbox).
BUG=47585 TEST=none Review URL: http://codereview.chromium.org/2858051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51751 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--views/controls/menu/menu_item_view.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/views/controls/menu/menu_item_view.cc b/views/controls/menu/menu_item_view.cc
index 1a5d8eb..b88fc5b 100644
--- a/views/controls/menu/menu_item_view.cc
+++ b/views/controls/menu/menu_item_view.cc
@@ -103,6 +103,19 @@ bool MenuItemView::GetAccessibleRole(AccessibilityTypes::Role* role) {
bool MenuItemView::GetAccessibleState(AccessibilityTypes::State* state) {
*state = 0;
+
+ switch (GetType()) {
+ case SUBMENU:
+ *state |= AccessibilityTypes::STATE_HASPOPUP;
+ case CHECKBOX:
+ case RADIO:
+ *state |= GetDelegate()->IsItemChecked(GetCommand()) ?
+ AccessibilityTypes::STATE_CHECKED : 0;
+ case NORMAL:
+ case SEPARATOR:
+ // No additional accessibility states currently for these menu states.
+ break;
+ }
return true;
}