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

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

Issue 2969113002: Forward BrowserAccessibilityWin table APIs to AXPlatformNodeWin. (Closed)
Patch Set: Rename 4X4 to 3X3. Off by one! Created 3 years, 5 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/test_ax_node_wrapper.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/test_ax_node_wrapper.cc
diff --git a/ui/accessibility/platform/test_ax_node_wrapper.cc b/ui/accessibility/platform/test_ax_node_wrapper.cc
index d1e33c778fa2ea373d63abbddb9fb5b47708c015..e0b153ef51200e36f36dc6639d43c6e89398ccfc 100644
--- a/ui/accessibility/platform/test_ax_node_wrapper.cc
+++ b/ui/accessibility/platform/test_ax_node_wrapper.cc
@@ -141,7 +141,28 @@ gfx::NativeViewAccessible TestAXNodeWrapper::GetFocus() {
return nullptr;
}
+// Walk the AXTree and ensure that all wrappers are created
+void TestAXNodeWrapper::BuildAllWrappers(AXTree* tree, AXNode* node) {
+ for (int i = 0; i < node->child_count(); i++) {
+ auto* child = node->children()[i];
+ TestAXNodeWrapper::GetOrCreate(tree, child);
+
+ BuildAllWrappers(tree, child);
+ }
+}
+
AXPlatformNode* TestAXNodeWrapper::GetFromNodeID(int32_t id) {
+ // Force creating all of the wrappers for this tree.
+ BuildAllWrappers(tree_, node_);
+
+ for (auto it = g_node_to_wrapper_map.begin();
+ it != g_node_to_wrapper_map.end(); ++it) {
+ AXNode* node = it->first;
+ if (node->id() == id) {
+ TestAXNodeWrapper* wrapper = it->second;
+ return wrapper->ax_platform_node();
+ }
+ }
return nullptr;
}
« no previous file with comments | « ui/accessibility/platform/test_ax_node_wrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698