Commit 97aa42e1 authored by James Wallace-Lee's avatar James Wallace-Lee Committed by Commit Bot

AutomationManagerAura::HandleEvent sends events on the root object by default

Sending an event requires an AXAuraObjWrapper, not an actual view, so
dispatch events on current_tree_->GetRoot() by default. This fixes a
crash in ChromeVox's mouse following where events are fired when there
is no active window (as when all windows are minimized).

Change-Id: I513d9b0547a5b31a7cf26a57648846c10bd86866
Reviewed-on: https://chromium-review.googlesource.com/c/1294517
Commit-Queue: James Wallace-Lee <jamwalla@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602030}
parent 72d81c09
......@@ -93,12 +93,11 @@ void AutomationManagerAura::HandleEvent(views::View* view,
}
void AutomationManagerAura::HandleEvent(ax::mojom::Event event_type) {
#if defined(OS_CHROMEOS)
aura::Window* root_window = ash::wm::GetActiveWindow();
views::Widget* widget = views::Widget::GetWidgetForNativeView(root_window);
if (widget)
HandleEvent(widget->GetRootView(), event_type);
#endif
views::AXAuraObjWrapper* obj = current_tree_->GetRoot();
if (!obj)
return;
AutomationManagerAura::SendEvent(obj, event_type);
}
void AutomationManagerAura::SendEventOnObjectById(int32_t id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment