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

Unified Diff: content/browser/accessibility/browser_accessibility_gtk.cc

Issue 25943003: Support accessible inline text boxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests, implement support for IsLeaf everywhere Created 7 years, 2 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
Index: content/browser/accessibility/browser_accessibility_gtk.cc
diff --git a/content/browser/accessibility/browser_accessibility_gtk.cc b/content/browser/accessibility/browser_accessibility_gtk.cc
index faf4c82e307830f3f42715050b7f2a43271b6887..f1266c4b8ef22974a997accc06332135c50f00e0 100644
--- a/content/browser/accessibility/browser_accessibility_gtk.cc
+++ b/content/browser/accessibility/browser_accessibility_gtk.cc
@@ -208,6 +208,10 @@ static gint browser_accessibility_get_n_children(AtkObject* atk_object) {
BrowserAccessibilityGtk* obj = ToBrowserAccessibilityGtk(atk_object);
if (!obj)
return 0;
+
+ if (obj->IsLeaf())
+ return 0;
+
return obj->children().size();
}
@@ -216,6 +220,13 @@ static AtkObject* browser_accessibility_ref_child(
BrowserAccessibilityGtk* obj = ToBrowserAccessibilityGtk(atk_object);
if (!obj)
return NULL;
+
+ if (obj->IsLeaf())
+ return NULL;
+
+ if (index < 0 || index >= static_cast<gint>(obj->children().size()))
+ return NULL;
+
AtkObject* result =
obj->children()[index]->ToBrowserAccessibilityGtk()->GetAtkObject();
g_object_ref(result);

Powered by Google App Engine
This is Rietveld 408576698