Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(878)

Unified Diff: views/controls/menu/submenu_view.cc

Issue 3015055: Enable better NVDA support for custom menus.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/menu/menu_scroll_view_container.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/submenu_view.cc
===================================================================
--- views/controls/menu/submenu_view.cc (revision 54772)
+++ views/controls/menu/submenu_view.cc (working copy)
@@ -5,6 +5,7 @@
#include "views/controls/menu/submenu_view.h"
#include "gfx/canvas.h"
+#include "views/accessibility/view_accessibility.h"
#include "views/controls/menu/menu_config.h"
#include "views/controls/menu/menu_controller.h"
#include "views/controls/menu/menu_host.h"
@@ -233,6 +234,9 @@
// Make sure the first row is visible.
ScrollRectToVisible(gfx::Rect(gfx::Point(), gfx::Size(1, 1)));
host_->Init(parent, bounds, scroll_view_container_, do_capture);
+
+ GetScrollViewContainer()->NotifyAccessibilityEvent(
+ AccessibilityTypes::EVENT_MENUPOPUPSTART);
}
void SubmenuView::Reposition(const gfx::Rect& bounds) {
@@ -242,6 +246,9 @@
void SubmenuView::Close() {
if (host_) {
+ GetScrollViewContainer()->NotifyAccessibilityEvent(
+ AccessibilityTypes::EVENT_MENUPOPUPEND);
+
host_->DestroyMenuHost();
host_ = NULL;
}
@@ -285,6 +292,11 @@
scroll_view_container_ = new MenuScrollViewContainer(this);
// Otherwise MenuHost would delete us.
scroll_view_container_->set_parent_owned(false);
+
+ // Use the parent menu item accessible name for the menu view.
+ std::wstring accessible_name;
+ GetMenuItem()->GetAccessibleName(&accessible_name);
+ scroll_view_container_->SetAccessibleName(accessible_name);
}
return scroll_view_container_;
}
« no previous file with comments | « views/controls/menu/menu_scroll_view_container.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698