Commit a38a42d6 authored by Jose Dapena Paz's avatar Jose Dapena Paz Committed by Commit Bot

AXPlatformNodeAuraLinux: add ref_accessible_at_point implementation.

Provide the hit test wrapper for AtkComponent interface, using
an implementation that is compatible with the one in
BrowserAccessibleAuraLinux.

Bug: 784583
Change-Id: Ie1dcae846db9aabf06e636eaf3054c87d2e8bcc9
Reviewed-on: https://chromium-review.googlesource.com/767428
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517786}
parent 27b69bb2
...@@ -271,10 +271,27 @@ static void ax_platform_node_auralinux_get_size(AtkComponent* atk_component, ...@@ -271,10 +271,27 @@ static void ax_platform_node_auralinux_get_size(AtkComponent* atk_component,
obj->GetSize(width, height); obj->GetSize(width, height);
} }
static AtkObject* ax_platform_node_auralinux_ref_accessible_at_point(
AtkComponent* atk_component,
gint x,
gint y,
AtkCoordType coord_type) {
g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_component);
ui::AXPlatformNodeAuraLinux* obj =
AtkObjectToAXPlatformNodeAuraLinux(atk_object);
if (!obj)
return nullptr;
return obj->HitTestSync(x, y, coord_type);
}
void ax_component_interface_base_init(AtkComponentIface* iface) { void ax_component_interface_base_init(AtkComponentIface* iface) {
iface->get_extents = ax_platform_node_auralinux_get_extents; iface->get_extents = ax_platform_node_auralinux_get_extents;
iface->get_position = ax_platform_node_auralinux_get_position; iface->get_position = ax_platform_node_auralinux_get_position;
iface->get_size = ax_platform_node_auralinux_get_size; iface->get_size = ax_platform_node_auralinux_get_size;
iface->ref_accessible_at_point =
ax_platform_node_auralinux_ref_accessible_at_point;
} }
static const GInterfaceInfo ComponentInfo = { static const GInterfaceInfo ComponentInfo = {
...@@ -747,4 +764,17 @@ void AXPlatformNodeAuraLinux::GetSize(gint* width, gint* height) { ...@@ -747,4 +764,17 @@ void AXPlatformNodeAuraLinux::GetSize(gint* width, gint* height) {
*height = rect_size.height(); *height = rect_size.height();
} }
gfx::NativeViewAccessible
AXPlatformNodeAuraLinux::HitTestSync(gint x, gint y, AtkCoordType coord_type) {
if (coord_type == ATK_XY_WINDOW) {
if (AtkObject* atk_object = GetParent()) {
gfx::Point window_coords = FindAtkObjectParentCoords(atk_object);
x += window_coords.x();
y += window_coords.y();
}
}
return delegate_->HitTestSync(x, y);
}
} // namespace ui } // namespace ui
...@@ -33,6 +33,9 @@ class AXPlatformNodeAuraLinux : public AXPlatformNodeBase { ...@@ -33,6 +33,9 @@ class AXPlatformNodeAuraLinux : public AXPlatformNodeBase {
AtkCoordType coord_type); AtkCoordType coord_type);
void GetPosition(gint* x, gint* y, AtkCoordType coord_type); void GetPosition(gint* x, gint* y, AtkCoordType coord_type);
void GetSize(gint* width, gint* height); void GetSize(gint* width, gint* height);
gfx::NativeViewAccessible HitTestSync(gint x,
gint y,
AtkCoordType coord_type);
void SetExtentsRelativeToAtkCoordinateType( void SetExtentsRelativeToAtkCoordinateType(
gint* x, gint* y, gint* width, gint* height, gint* x, gint* y, gint* width, gint* height,
......
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