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

Unified Diff: views/accessibility/view_accessibility.cc

Issue 2823009: Keep a map of all views that have sent notifications. This ensures that Acce... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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/accessibility/view_accessibility.h ('k') | views/focus/focus_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/accessibility/view_accessibility.cc
===================================================================
--- views/accessibility/view_accessibility.cc (revision 50246)
+++ views/accessibility/view_accessibility.cc (working copy)
@@ -290,9 +290,24 @@
// Check to see if child is out-of-bounds.
if (IsValidChild((var_child.lVal - 1), view_)) {
child_view = view_->GetChildViewAt(var_child.lVal - 1);
+
+ // Parents handle leaf IAccessible's.
+ if (child_view && child_view->GetChildViewCount() == 0)
+ return S_FALSE;
} else {
- // Child is located elsewhere in the hierarchy, get ID and adjust for MSAA.
- child_view = view_->GetViewByID(static_cast<int>(var_child.lVal));
+ // Child is located elsewhere in this view's subtree.
+ // Positive child id's are 1-based indexes so you can iterate over all
+ // children, and negative values are direct references to objects.
+ // Note that we return full IAccessible's for leafs that have
+ // negative child id's.
+ if (var_child.lVal > 0) {
+ child_view = view_->GetViewByID(static_cast<int>(var_child.lVal));
+ } else {
+ // Retrieve it from our cache of views that have fired events.
+ views::WidgetWin* view_widget =
+ static_cast<views::WidgetWin*>(view_->GetWidget());
+ child_view = view_widget->GetAccessibilityViewEventAt(var_child.lVal);
+ }
}
if (!child_view) {
@@ -756,6 +771,25 @@
return E_NOTIMPL;
}
+int32 ViewAccessibility::MSAAEvent(AccessibilityTypes::Event event) {
+ switch (event) {
+ case AccessibilityTypes::EVENT_FOCUS:
+ return EVENT_OBJECT_FOCUS;
+ case AccessibilityTypes::EVENT_MENUSTART:
+ return EVENT_SYSTEM_MENUSTART;
+ case AccessibilityTypes::EVENT_MENUEND:
+ return EVENT_SYSTEM_MENUEND;
+ case AccessibilityTypes::EVENT_MENUPOPUPSTART:
+ return EVENT_SYSTEM_MENUPOPUPSTART;
+ case AccessibilityTypes::EVENT_MENUPOPUPEND:
+ return EVENT_SYSTEM_MENUPOPUPEND;
+ default:
+ // Not supported or invalid event.
+ NOTREACHED();
+ return -1;
+ }
+}
+
int32 ViewAccessibility::MSAARole(AccessibilityTypes::Role role) {
switch (role) {
case AccessibilityTypes::ROLE_APPLICATION:
« no previous file with comments | « views/accessibility/view_accessibility.h ('k') | views/focus/focus_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698