Commit 9570c41a authored by dougt's avatar dougt Committed by Commit Bot

Forward BrowserAccessibility accSelect() to AXPlatformNode.

This forwards accSelect to the AXPlatformNode. In order to do this, we
had to extension AccessibilityPerformAction a bit to be able to handle
AX_ACTION_FOCUS. Not that the node id is not passed as part of the AXActionData
and is not being used by the delegate at this point.

BUG=703369

Review-Url: https://codereview.chromium.org/2913553003
Cr-Commit-Position: refs/heads/master@{#475806}
parent 9a9457b3
......@@ -1218,6 +1218,11 @@ bool BrowserAccessibility::AccessibilityPerformAction(
return true;
}
if (data.action == ui::AX_ACTION_FOCUS) {
manager_->SetFocus(*this);
return true;
}
return false;
}
......
......@@ -780,16 +780,7 @@ STDMETHODIMP BrowserAccessibilityComWin::accSelect(LONG flags_sel,
if (!owner())
return E_FAIL;
auto* manager = Manager();
if (!manager)
return E_FAIL;
if (flags_sel & SELFLAG_TAKEFOCUS) {
manager->SetFocus(*owner());
return S_OK;
}
return S_FALSE;
return AXPlatformNodeWin::accSelect(flags_sel, var_id);
}
STDMETHODIMP
......
......@@ -550,8 +550,6 @@ STDMETHODIMP AXPlatformNodeWin::put_accValue(VARIANT var_id,
return E_FAIL;
}
// IAccessible functions not supported.
STDMETHODIMP AXPlatformNodeWin::get_accSelection(VARIANT* selected) {
COM_OBJECT_VALIDATE_1_ARG(selected);
if (selected)
......@@ -561,7 +559,17 @@ STDMETHODIMP AXPlatformNodeWin::get_accSelection(VARIANT* selected) {
STDMETHODIMP AXPlatformNodeWin::accSelect(
LONG flagsSelect, VARIANT var_id) {
return E_NOTIMPL;
AXPlatformNodeWin* target;
COM_OBJECT_VALIDATE_VAR_ID_AND_GET_TARGET(var_id, target);
if (flagsSelect & SELFLAG_TAKEFOCUS) {
ui::AXActionData action_data;
action_data.action = ui::AX_ACTION_FOCUS;
target->delegate_->AccessibilityPerformAction(action_data);
return S_OK;
}
return S_FALSE;
}
STDMETHODIMP AXPlatformNodeWin::get_accHelpTopic(
......
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