9 #include "flutter/fml/logging.h"
12 #include "flutter/third_party/accessibility/ax/ax_clipping_behavior.h"
13 #include "flutter/third_party/accessibility/ax/ax_coordinate_system.h"
14 #include "flutter/third_party/accessibility/ax/platform/ax_fragment_root_win.h"
19 std::weak_ptr<AccessibilityBridge> bridge,
21 : bridge_(bridge), view_(view) {
22 FML_DCHECK(!bridge_.expired())
23 <<
"Expired AccessibilityBridge passed to node delegate";
28 if (ax_platform_node_) {
29 ax_platform_node_->Destroy();
41 ax_platform_node_ = ui::AXPlatformNode::Create(
this);
42 FML_DCHECK(ax_platform_node_) <<
"Failed to create AXPlatformNode";
46 gfx::NativeViewAccessible
48 FML_DCHECK(ax_platform_node_) <<
"AXPlatformNode hasn't been created";
49 return ax_platform_node_->GetNativeViewAccessible();
54 int screen_physical_pixel_x,
55 int screen_physical_pixel_y)
const {
57 ui::AXOffscreenResult result;
58 gfx::Rect rect =
GetBoundsRect(ui::AXCoordinateSystem::kScreenPhysicalPixels,
59 ui::AXClippingBehavior::kUnclipped, &result);
60 gfx::Point screen_point(screen_physical_pixel_x, screen_physical_pixel_y);
61 if (!rect.Contains(screen_point)) {
66 auto bridge = bridge_.lock();
68 for (
const ui::AXNode* child :
GetAXNode()->children()) {
69 std::shared_ptr<FlutterPlatformNodeDelegateWindows> win_delegate =
70 std::static_pointer_cast<FlutterPlatformNodeDelegateWindows>(
71 bridge->GetFlutterPlatformNodeDelegateFromID(child->id()).lock());
72 FML_DCHECK(win_delegate)
73 <<
"No FlutterPlatformNodeDelegate found for node " << child->id();
74 auto hit_view = win_delegate->HitTestSync(screen_physical_pixel_x,
75 screen_physical_pixel_y);
82 return ax_platform_node_->GetNativeViewAccessible();
87 const ui::AXCoordinateSystem coordinate_system,
88 const ui::AXClippingBehavior clipping_behavior,
89 ui::AXOffscreenResult* offscreen_result)
const {
91 coordinate_system, clipping_behavior, offscreen_result);
92 POINT origin{bounds.x(), bounds.y()};
93 POINT extent{bounds.x() + bounds.width(), bounds.y() + bounds.height()};
96 return gfx::Rect(origin.x, origin.y, extent.x - origin.x,
102 ax_platform_node_->NotifyAccessibilityEvent(
event_type);
108 varchild.lVal = CHILDID_SELF;
112 gfx::AcceleratedWidget
119 return ax_platform_node_;
ax::mojom::Event event_type
bool iaccessibleex_enabled() const
FlutterWindowsEngine * GetEngine() const
virtual HWND GetWindowHandle() const