summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/menu_controller.cc
diff options
context:
space:
mode:
authordtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 22:28:09 +0000
committerdtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 22:28:09 +0000
commit66bc725eb396ef3ed84c071c992a32a397ddb21d (patch)
treea5732ed6287f311eb23749859bd732ed3b11d370 /views/controls/menu/menu_controller.cc
parent0f9141e83df10e173bc04fa57b11483ab4d5bde3 (diff)
downloadchromium_src-66bc725eb396ef3ed84c071c992a32a397ddb21d.zip
chromium_src-66bc725eb396ef3ed84c071c992a32a397ddb21d.tar.gz
chromium_src-66bc725eb396ef3ed84c071c992a32a397ddb21d.tar.bz2
Hook up the MenuViewItem objects to a widget so that they may send accessibility focus events.
BUG=47585 TEST=none Review URL: http://codereview.chromium.org/2872022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/menu_controller.cc')
-rw-r--r--views/controls/menu/menu_controller.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc
index af43934..ae099f7 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -244,6 +244,9 @@ MenuItemView* MenuController::Run(gfx::NativeWindow parent,
owner_ = parent;
+ if (button)
+ button->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_MENUPOPUPSTART);
+
// Set the selection, which opens the initial menu.
SetSelection(root, true, true);
@@ -370,6 +373,17 @@ void MenuController::SetSelection(MenuItemView* menu_item,
CommitPendingSelection();
else
StartShowTimer();
+
+ // Notify an accessibility focus event on all menu items except for the root.
+ if (menu_item &&
+ (MenuDepth(menu_item) != 1 ||
+ menu_item->GetType() != MenuItemView::SUBMENU))
+ menu_item->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS);
+
+ if (menu_button_ && !menu_item && exit_type_ != EXIT_DESTROYED) {
+ menu_button_->
+ NotifyAccessibilityEvent(AccessibilityTypes::EVENT_MENUPOPUPEND);
+ }
}
void MenuController::Cancel(ExitType type) {