Flutter Engine
 
Loading...
Searching...
No Matches
accessibility_bridge_windows.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
10
11namespace flutter {
12
17
20 ui::AXNode* ax_node = targeted_event.node;
22
23 auto node_delegate =
26 << "No FlutterPlatformNodeDelegate found for node ID " << ax_node->id();
27 std::shared_ptr<FlutterPlatformNodeDelegateWindows> win_delegate =
28 std::static_pointer_cast<FlutterPlatformNodeDelegateWindows>(
30
31 switch (event_type) {
34 break;
38 break;
42 break;
44 // An event indicating a change in document selection should be fired
45 // only for the focused node whose selection has changed. If a valid
46 // caret and selection exist in the app tree, they must both be within
47 // the focus node.
48 auto focus_delegate = GetFocusedNode().lock();
49 if (focus_delegate) {
50 win_delegate =
51 std::static_pointer_cast<FlutterPlatformNodeDelegateWindows>(
52 focus_delegate);
53 }
56 break;
57 }
60 SetFocus(win_delegate);
61 break;
63 if (ax_node->IsIgnored()) {
65 }
66 break;
70 break;
74 break;
78 break;
82 break;
86 break;
90 break;
94 break;
97 break;
101 break;
105 break;
157 // Unhandled event type.
158 break;
159 }
160}
161
169
170std::shared_ptr<FlutterPlatformNodeDelegate>
172 return std::make_shared<FlutterPlatformNodeDelegateWindows>(
173 shared_from_this(), view_);
174}
175
177 std::shared_ptr<FlutterPlatformNodeDelegateWindows> node_delegate,
179 node_delegate->DispatchWinAccessibilityEvent(event_type);
180}
181
183 std::shared_ptr<FlutterPlatformNodeDelegateWindows> node_delegate) {
184 node_delegate->SetFocus();
185}
186
189 ui::AXPlatformNodeDelegate* root_delegate = RootDelegate();
190 if (!root_delegate) {
191 return nullptr;
192 }
193
194 return root_delegate->GetNativeViewAccessible();
195}
196
201
205
206std::weak_ptr<FlutterPlatformNodeDelegate>
211
212} // namespace flutter
std::shared_ptr< FlutterPlatformNodeDelegateWindows > node_delegate
ax::mojom::Event event_type
ui::AXPlatformNodeDelegate * RootDelegate() const override
std::weak_ptr< FlutterPlatformNodeDelegate > GetFlutterPlatformNodeDelegateFromID(AccessibilityNodeId id) const
Get the flutter platform node delegate with the given id from this accessibility bridge....
const ui::AXTreeData & GetAXTreeData() const
Get the ax tree data from this accessibility bridge. The tree data contains information such as the i...
virtual void DispatchWinAccessibilityEvent(std::shared_ptr< FlutterPlatformNodeDelegateWindows > node_delegate, ax::mojom::Event event_type)
virtual std::weak_ptr< FlutterPlatformNodeDelegate > GetFocusedNode()
std::shared_ptr< FlutterPlatformNodeDelegate > CreateFlutterPlatformNodeDelegate() override
Creates a platform specific FlutterPlatformNodeDelegate. Ownership passes to the caller....
void DispatchAccessibilityAction(AccessibilityNodeId target, FlutterSemanticsAction action, fml::MallocMapping data) override
Dispatch accessibility action back to the Flutter framework. These actions are generated in the nativ...
virtual void SetFocus(std::shared_ptr< FlutterPlatformNodeDelegateWindows > node_delegate)
gfx::NativeViewAccessible GetChildOfAXFragmentRoot() override
gfx::NativeViewAccessible GetParentOfAXFragmentRoot() override
void OnAccessibilityEvent(ui::AXEventGenerator::TargetedEvent targeted_event) override
Handle accessibility events generated due to accessibility tree changes. These events are needed to b...
bool DispatchSemanticsAction(FlutterViewId view_id, uint64_t node_id, FlutterSemanticsAction action, fml::MallocMapping data)
FlutterWindowsEngine * GetEngine() const
A Mapping like NonOwnedMapping, but uses Free as its release proc.
Definition mapping.h:144
AXID id() const
Definition ax_node.h:110
int32_t AXID
Definition ax_node.h:36
bool IsIgnored() const
Definition ax_node.cc:1074
virtual gfx::NativeViewAccessible GetNativeViewAccessible()=0
FlutterSemanticsAction
Definition embedder.h:115
FlView * view
uint32_t * target
#define FML_DCHECK(condition)
Definition logging.h:122
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switch_defs.h:36
ui::AXNode::AXID AccessibilityNodeId
UnimplementedNativeViewAccessible * NativeViewAccessible
AXNode::AXID sel_focus_object_id