7 #include "flutter/fml/logging.h"
9 #include "flutter/third_party/accessibility/ax/platform/ax_platform_node_delegate_base.h"
19 ui::AXEventGenerator::TargetedEvent targeted_event) {
20 ui::AXNode* ax_node = targeted_event.node;
21 ui::AXEventGenerator::Event
event_type = targeted_event.event_params.event;
26 <<
"No FlutterPlatformNodeDelegate found for node ID " << ax_node->id();
27 std::shared_ptr<FlutterPlatformNodeDelegateWindows> win_delegate =
28 std::static_pointer_cast<FlutterPlatformNodeDelegateWindows>(
32 case ui::AXEventGenerator::Event::ALERT:
35 case ui::AXEventGenerator::Event::CHECKED_STATE_CHANGED:
37 ax::mojom::Event::kValueChanged);
39 case ui::AXEventGenerator::Event::CHILDREN_CHANGED:
41 ax::mojom::Event::kChildrenChanged);
43 case ui::AXEventGenerator::Event::DOCUMENT_SELECTION_CHANGED: {
51 std::static_pointer_cast<FlutterPlatformNodeDelegateWindows>(
55 win_delegate, ax::mojom::Event::kDocumentSelectionChanged);
58 case ui::AXEventGenerator::Event::FOCUS_CHANGED:
62 case ui::AXEventGenerator::Event::IGNORED_CHANGED:
63 if (ax_node->IsIgnored()) {
67 case ui::AXEventGenerator::Event::IMAGE_ANNOTATION_CHANGED:
69 ax::mojom::Event::kTextChanged);
71 case ui::AXEventGenerator::Event::LIVE_REGION_CHANGED:
73 ax::mojom::Event::kLiveRegionChanged);
75 case ui::AXEventGenerator::Event::NAME_CHANGED:
77 ax::mojom::Event::kTextChanged);
79 case ui::AXEventGenerator::Event::SCROLL_HORIZONTAL_POSITION_CHANGED:
81 ax::mojom::Event::kScrollPositionChanged);
83 case ui::AXEventGenerator::Event::SCROLL_VERTICAL_POSITION_CHANGED:
85 ax::mojom::Event::kScrollPositionChanged);
87 case ui::AXEventGenerator::Event::SELECTED_CHANGED:
89 ax::mojom::Event::kValueChanged);
91 case ui::AXEventGenerator::Event::SELECTED_CHILDREN_CHANGED:
93 ax::mojom::Event::kSelectedChildrenChanged);
95 case ui::AXEventGenerator::Event::SUBTREE_CREATED:
98 case ui::AXEventGenerator::Event::VALUE_CHANGED:
100 ax::mojom::Event::kValueChanged);
102 case ui::AXEventGenerator::Event::WIN_IACCESSIBLE_STATE_CHANGED:
104 ax::mojom::Event::kStateChanged);
106 case ui::AXEventGenerator::Event::ACCESS_KEY_CHANGED:
107 case ui::AXEventGenerator::Event::ACTIVE_DESCENDANT_CHANGED:
108 case ui::AXEventGenerator::Event::ATK_TEXT_OBJECT_ATTRIBUTE_CHANGED:
109 case ui::AXEventGenerator::Event::ATOMIC_CHANGED:
110 case ui::AXEventGenerator::Event::AUTO_COMPLETE_CHANGED:
111 case ui::AXEventGenerator::Event::BUSY_CHANGED:
112 case ui::AXEventGenerator::Event::CLASS_NAME_CHANGED:
113 case ui::AXEventGenerator::Event::COLLAPSED:
114 case ui::AXEventGenerator::Event::CONTROLS_CHANGED:
115 case ui::AXEventGenerator::Event::DESCRIBED_BY_CHANGED:
116 case ui::AXEventGenerator::Event::DESCRIPTION_CHANGED:
117 case ui::AXEventGenerator::Event::DOCUMENT_TITLE_CHANGED:
118 case ui::AXEventGenerator::Event::DROPEFFECT_CHANGED:
119 case ui::AXEventGenerator::Event::ENABLED_CHANGED:
120 case ui::AXEventGenerator::Event::EXPANDED:
121 case ui::AXEventGenerator::Event::FLOW_FROM_CHANGED:
122 case ui::AXEventGenerator::Event::FLOW_TO_CHANGED:
123 case ui::AXEventGenerator::Event::GRABBED_CHANGED:
124 case ui::AXEventGenerator::Event::HASPOPUP_CHANGED:
125 case ui::AXEventGenerator::Event::HIERARCHICAL_LEVEL_CHANGED:
126 case ui::AXEventGenerator::Event::INVALID_STATUS_CHANGED:
127 case ui::AXEventGenerator::Event::KEY_SHORTCUTS_CHANGED:
128 case ui::AXEventGenerator::Event::LABELED_BY_CHANGED:
129 case ui::AXEventGenerator::Event::LANGUAGE_CHANGED:
130 case ui::AXEventGenerator::Event::LAYOUT_INVALIDATED:
131 case ui::AXEventGenerator::Event::LIVE_REGION_CREATED:
132 case ui::AXEventGenerator::Event::LIVE_REGION_NODE_CHANGED:
133 case ui::AXEventGenerator::Event::LIVE_RELEVANT_CHANGED:
134 case ui::AXEventGenerator::Event::LIVE_STATUS_CHANGED:
135 case ui::AXEventGenerator::Event::LOAD_COMPLETE:
136 case ui::AXEventGenerator::Event::LOAD_START:
137 case ui::AXEventGenerator::Event::MENU_ITEM_SELECTED:
138 case ui::AXEventGenerator::Event::MULTILINE_STATE_CHANGED:
139 case ui::AXEventGenerator::Event::MULTISELECTABLE_STATE_CHANGED:
140 case ui::AXEventGenerator::Event::OBJECT_ATTRIBUTE_CHANGED:
141 case ui::AXEventGenerator::Event::OTHER_ATTRIBUTE_CHANGED:
142 case ui::AXEventGenerator::Event::PLACEHOLDER_CHANGED:
143 case ui::AXEventGenerator::Event::PORTAL_ACTIVATED:
144 case ui::AXEventGenerator::Event::POSITION_IN_SET_CHANGED:
145 case ui::AXEventGenerator::Event::READONLY_CHANGED:
146 case ui::AXEventGenerator::Event::RELATED_NODE_CHANGED:
147 case ui::AXEventGenerator::Event::REQUIRED_STATE_CHANGED:
148 case ui::AXEventGenerator::Event::ROLE_CHANGED:
149 case ui::AXEventGenerator::Event::ROW_COUNT_CHANGED:
150 case ui::AXEventGenerator::Event::SET_SIZE_CHANGED:
151 case ui::AXEventGenerator::Event::SORT_CHANGED:
152 case ui::AXEventGenerator::Event::STATE_CHANGED:
153 case ui::AXEventGenerator::Event::TEXT_ATTRIBUTE_CHANGED:
154 case ui::AXEventGenerator::Event::VALUE_MAX_CHANGED:
155 case ui::AXEventGenerator::Event::VALUE_MIN_CHANGED:
156 case ui::AXEventGenerator::Event::VALUE_STEP_CHANGED:
164 FlutterSemanticsAction
action,
165 fml::MallocMapping data) {
169 std::shared_ptr<FlutterPlatformNodeDelegate>
171 return std::make_shared<FlutterPlatformNodeDelegateWindows>(
172 shared_from_this(), view_);
176 std::shared_ptr<FlutterPlatformNodeDelegateWindows>
node_delegate,
182 std::shared_ptr<FlutterPlatformNodeDelegateWindows>
node_delegate) {
186 gfx::NativeViewAccessible
188 ui::AXPlatformNodeDelegate* root_delegate =
RootDelegate();
189 if (!root_delegate) {
193 return root_delegate->GetNativeViewAccessible();
196 gfx::NativeViewAccessible
205 std::weak_ptr<FlutterPlatformNodeDelegate>
207 ui::AXNode::AXID focus_id =
GetAXTreeData().sel_focus_object_id;