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

Unified Diff: ui/accessibility/platform/ax_platform_node_auralinux.cc

Issue 1029043002: Implementing ATK functions get_index_in_parent & ref_relation_set for Chrome UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing one more nit Created 5 years, 9 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 | « ui/accessibility/platform/ax_platform_node_auralinux.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/platform/ax_platform_node_auralinux.cc
diff --git a/ui/accessibility/platform/ax_platform_node_auralinux.cc b/ui/accessibility/platform/ax_platform_node_auralinux.cc
index ad55defc5a2f43d11c4738eb4a2b8803eadbd29c..3ecb4e4604dddb2d511f4da1744f5de3d0e6d86a 100644
--- a/ui/accessibility/platform/ax_platform_node_auralinux.cc
+++ b/ui/accessibility/platform/ax_platform_node_auralinux.cc
@@ -86,6 +86,28 @@ static const gchar* ax_platform_node_auralinux_get_description(
ui::AX_ATTR_DESCRIPTION).c_str();
}
+static gint ax_platform_node_auralinux_get_index_in_parent(
+ AtkObject* atk_object) {
+ ui::AXPlatformNodeAuraLinux* obj =
+ AtkObjectToAXPlatformNodeAuraLinux(atk_object);
+
+ if (!obj || !obj->GetParent())
+ return -1;
+
+ AtkObject* obj_parent = obj->GetParent();
+
+ unsigned child_count = atk_object_get_n_accessible_children(obj_parent);
+ for (unsigned index = 0; index < child_count; index++) {
+ AtkObject* child = atk_object_ref_accessible_child(obj_parent, index);
+ bool atk_object_found = child == atk_object;
+ g_object_unref(child);
+ if (atk_object_found)
+ return index;
+ }
+
+ return obj->GetIndexInParent();
+}
+
static AtkObject* ax_platform_node_auralinux_get_parent(AtkObject* atk_object) {
ui::AXPlatformNodeAuraLinux* obj =
AtkObjectToAXPlatformNodeAuraLinux(atk_object);
@@ -117,6 +139,21 @@ static AtkObject* ax_platform_node_auralinux_ref_child(
return result;
}
+static AtkRelationSet* ax_platform_node_auralinux_ref_relation_set(
+ AtkObject* atk_object) {
+ ui::AXPlatformNodeAuraLinux* obj =
+ AtkObjectToAXPlatformNodeAuraLinux(atk_object);
+ AtkRelationSet* atk_relation_set =
+ ATK_OBJECT_CLASS(ax_platform_node_auralinux_parent_class)->
+ ref_relation_set(atk_object);
+
+ if (!obj)
+ return atk_relation_set;
+
+ obj->GetAtkRelations(atk_relation_set);
+ return atk_relation_set;
+}
+
static AtkRole ax_platform_node_auralinux_get_role(AtkObject* atk_object) {
ui::AXPlatformNodeAuraLinux* obj =
AtkObjectToAXPlatformNodeAuraLinux(atk_object);
@@ -175,6 +212,8 @@ static void ax_platform_node_auralinux_class_init(AtkObjectClass* klass) {
klass->ref_child = ax_platform_node_auralinux_ref_child;
klass->get_role = ax_platform_node_auralinux_get_role;
klass->ref_state_set = ax_platform_node_auralinux_ref_state_set;
+ klass->get_index_in_parent = ax_platform_node_auralinux_get_index_in_parent;
+ klass->ref_relation_set = ax_platform_node_auralinux_ref_relation_set;
}
GType ax_platform_node_auralinux_get_type() {
@@ -315,6 +354,10 @@ void AXPlatformNodeAuraLinux::GetAtkState(AtkStateSet* state_set) {
atk_state_set_add_state(state_set, ATK_STATE_SELECTED);
}
+void AXPlatformNodeAuraLinux::GetAtkRelations(AtkRelationSet* atk_relation_set)
+{
+}
+
AXPlatformNodeAuraLinux::AXPlatformNodeAuraLinux()
: atk_object_(nullptr) {
}
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_auralinux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698