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

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

Issue 2816273002: Implement GetParent, GetChildCount, ChildAtIndex on BrowserAccessibility (Closed)
Patch Set: comment nit Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility.cc
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc
index 95647cb7b211f539967c7e0611bba5342ecc1398..f01220a943d3bebd252fc85746dd94e38455774c 100644
--- a/content/browser/accessibility/browser_accessibility.cc
+++ b/content/browser/accessibility/browser_accessibility.cc
@@ -1134,7 +1134,9 @@ gfx::Rect BrowserAccessibility::RelativeToAbsoluteBounds(
return gfx::ToEnclosingRect(bounds);
}
+//
// AXPlatformNodeDelegate.
+//
const ui::AXNodeData& BrowserAccessibility::GetData() const {
CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ());
if (node_)
@@ -1149,17 +1151,20 @@ gfx::NativeWindow BrowserAccessibility::GetTopLevelWidget() {
}
gfx::NativeViewAccessible BrowserAccessibility::GetParent() {
- NOTREACHED();
+ auto* parent = PlatformGetParent();
+ if (parent && parent->platform_node_)
+ return parent->platform_node_->GetNativeViewAccessible();
return nullptr;
}
int BrowserAccessibility::GetChildCount() {
- NOTREACHED();
- return -1;
+ return PlatformChildCount();
}
gfx::NativeViewAccessible BrowserAccessibility::ChildAtIndex(int index) {
- NOTREACHED();
+ auto* child = PlatformGetChild(index);
+ if (child && child->platform_node_)
+ return child->platform_node_->GetNativeViewAccessible();
return nullptr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698