Chromium Code Reviews| Index: ui/views/accessibility/ax_widget_obj_wrapper.cc |
| diff --git a/ui/views/accessibility/ax_widget_obj_wrapper.cc b/ui/views/accessibility/ax_widget_obj_wrapper.cc |
| index 2d96f8c9400ae7c5aef7beb37385384395b92871..20292b2d48aac8687f392a5150dec05979ad878d 100644 |
| --- a/ui/views/accessibility/ax_widget_obj_wrapper.cc |
| +++ b/ui/views/accessibility/ax_widget_obj_wrapper.cc |
| @@ -5,6 +5,7 @@ |
| #include "ui/views/accessibility/ax_widget_obj_wrapper.h" |
| #include "base/strings/utf_string_conversions.h" |
| +#include "ui/accessibility/ax_action_data.h" |
| #include "ui/accessibility/ax_node_data.h" |
| #include "ui/views/accessibility/ax_aura_obj_cache.h" |
| #include "ui/views/accessibility/ax_aura_obj_wrapper.h" |
| @@ -56,6 +57,29 @@ int32_t AXWidgetObjWrapper::GetID() { |
| return AXAuraObjCache::GetInstance()->GetID(widget_); |
| } |
| +bool AXWidgetObjWrapper::HandleAccessibleAction( |
|
David Tseng
2017/04/06 16:45:44
I think this is the wrong level of abstraction to
dmazzoni
2017/04/07 23:34:09
No, because a HIT_TEST is fired on the root. We ju
|
| + const ui::AXActionData& action) { |
| + if (action.action == ui::AX_ACTION_HIT_TEST) { |
| + // For a hit test event, try to delegate to a View, and if that |
| + // fails fire the event directly. |
| + views::View* root_view = widget_->GetRootView(); |
| + views::View* hit_view = |
| + root_view->GetEventHandlerForPoint(action.target_point); |
| + if (hit_view) { |
| + AXAuraObjWrapper* view_wrapper = |
| + AXAuraObjCache::GetInstance()->GetOrCreate(hit_view); |
| + if (view_wrapper) |
| + return view_wrapper->HandleAccessibleAction(action); |
| + } |
| + |
| + AXAuraObjCache::GetInstance()->FireEvent(this, |
| + action.hit_test_event_to_fire); |
| + return true; |
| + } |
| + |
| + return false; |
| +} |
| + |
| void AXWidgetObjWrapper::OnWidgetDestroying(Widget* widget) { |
| AXAuraObjCache::GetInstance()->Remove(widget); |
| } |