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

Unified Diff: ui/accessibility/platform/ax_platform_node_win.h

Issue 2975413002: Move ia2_attributes handling to AXPlatformNodeWin. (Closed)
Patch Set: Initial 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
Index: ui/accessibility/platform/ax_platform_node_win.h
diff --git a/ui/accessibility/platform/ax_platform_node_win.h b/ui/accessibility/platform/ax_platform_node_win.h
index a08df798ad6a024939b51ddbc67836def2358ac5..6c2f0cae09c715ed94dff3cf9373e81c2592ee8d 100644
--- a/ui/accessibility/platform/ax_platform_node_win.h
+++ b/ui/accessibility/platform/ax_platform_node_win.h
@@ -425,10 +425,15 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
int32_t IA2Role();
+ std::vector<base::string16> IA2Attributes();
+
// AXPlatformNodeBase overrides.
void Dispose() override;
private:
+ // IAccessible2 attributes.
+ std::vector<base::string16> ia2_attributes_;
+
int MSAAEvent(ui::AXEvent event);
bool IsWebAreaForPresentationalIframe();
bool ShouldNodeHaveReadonlyState(const AXNodeData& data) const;
@@ -438,6 +443,30 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
ui::AXStringAttribute attribute,
BSTR* value_bstr) const;
+ // Escapes characters in string attributes as required by the IA2 Spec.
+ // It's okay for input to be the same as output.
+ static void SanitizeStringAttributeForIA2(const base::string16& input,
+ base::string16* output);
+ /*
dmazzoni 2017/07/17 08:27:18 Fix this before landing?
dougt 2017/07/17 19:28:27 Done.
+ FRIEND_TEST_ALL_PREFIXES(BrowserAccessibilityTest,
+ TestSanitizeStringAttributeForIA2);
+ */
+ // Sets the selection given a start and end offset in IA2 Hypertext.
+ void SetIA2HypertextSelection(LONG start_offset, LONG end_offset);
+
+ // If the string attribute |attribute| is present, add its value as an
+ // IAccessible2 attribute with the name |ia2_attr|.
+ void StringAttributeToIA2(ui::AXStringAttribute attribute,
+ const char* ia2_attr);
+
+ // If the bool attribute |attribute| is present, add its value as an
+ // IAccessible2 attribute with the name |ia2_attr|.
+ void BoolAttributeToIA2(ui::AXBoolAttribute attribute, const char* ia2_attr);
+
+ // If the int attribute |attribute| is present, add its value as an
+ // IAccessible2 attribute with the name |ia2_attr|.
+ void IntAttributeToIA2(ui::AXIntAttribute attribute, const char* ia2_attr);
+
void AddAlertTarget();
void RemoveAlertTarget();

Powered by Google App Engine
This is Rietveld 408576698