Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f34fdd3

Browse files
PR
1 parent 58af826 commit f34fdd3

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

shell/platform/windows/accessibility_alert.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace flutter {
1010

1111
AccessibilityAlert::AccessibilityAlert() : text_(L""), parent_(nullptr) {}
1212

13+
// IAccessible methods.
14+
1315
IFACEMETHODIMP AccessibilityAlert::accHitTest(LONG screen_physical_pixel_x,
1416
LONG screen_physical_pixel_y,
1517
VARIANT* child) {
@@ -157,6 +159,8 @@ IFACEMETHODIMP AccessibilityAlert::put_accName(VARIANT var_id, BSTR put_name) {
157159
return E_NOTIMPL;
158160
}
159161

162+
// End of IAccessible methods.
163+
160164
void AccessibilityAlert::SetText(const std::wstring& text) {
161165
text_ = text;
162166
}

shell/platform/windows/accessibility_alert.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ namespace flutter {
1616
class AccessibilityRootNode;
1717

1818
// An IAccessible node representing an alert read to the screen reader.
19+
// When an announcement is requested by the framework, an instance of
20+
// this class, if none exists already, is created and made a child of
21+
// the root AccessibilityRootNode node, and is therefore also a sibling
22+
// of the window's root node.
23+
// This node is not interactable to the user.
1924
class AccessibilityAlert : public CComObjectRootEx<CComMultiThreadModel>,
2025
public IDispatchImpl<IAccessible> {
2126
public:
@@ -31,8 +36,6 @@ class AccessibilityAlert : public CComObjectRootEx<CComMultiThreadModel>,
3136
LONG screen_physical_pixel_y,
3237
VARIANT* child) override;
3338

34-
// Performs the object's default action.
35-
3639
// Retrieves an IDispatch interface pointer for the specified child.
3740
IFACEMETHODIMP get_accChild(VARIANT var_child,
3841
IDispatch** disp_child) override;
@@ -47,8 +50,6 @@ class AccessibilityAlert : public CComObjectRootEx<CComMultiThreadModel>,
4750
// Retrieves the tooltip description.
4851
IFACEMETHODIMP get_accDescription(VARIANT var_id, BSTR* desc) override;
4952

50-
// Retrieves the object that has the keyboard focus.
51-
5253
// Retrieves the name of the specified object.
5354
IFACEMETHODIMP get_accName(VARIANT var_id, BSTR* name) override;
5455

@@ -64,9 +65,7 @@ class AccessibilityAlert : public CComObjectRootEx<CComMultiThreadModel>,
6465
// Gets the help string for the specified object.
6566
IFACEMETHODIMP get_accHelp(VARIANT var_id, BSTR* help) override;
6667

67-
// Retrieve or set the string value associated with the specified object.
68-
// Setting the value is not typically used by screen readers, but it's
69-
// used frequently by automation software.
68+
// Retrieve the string value associated with the specified object.
7069
IFACEMETHODIMP get_accValue(VARIANT var_id, BSTR* value) override;
7170

7271
// IAccessible methods not implemented.
@@ -90,6 +89,8 @@ class AccessibilityAlert : public CComObjectRootEx<CComMultiThreadModel>,
9089
IFACEMETHODIMP put_accName(VARIANT var_id, BSTR put_name) override;
9190
IFACEMETHODIMP put_accValue(VARIANT var_id, BSTR new_value) override;
9291

92+
// End of IAccessible methods.
93+
9394
AccessibilityAlert();
9495
~AccessibilityAlert() = default;
9596

shell/platform/windows/accessibility_root_node.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ IFACEMETHODIMP AccessibilityRootNode::get_accName(VARIANT var_id,
170170
}
171171
IAccessible* target;
172172
if ((target = GetTargetAndChildID(&var_id))) {
173-
return window_accessible_->get_accName(var_id, name_bstr);
173+
return target->get_accName(var_id, name_bstr);
174174
}
175175
return S_FALSE;
176176
}

0 commit comments

Comments
 (0)