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

Unified Diff: content/common/accessibility_mode_enums.h

Issue 2558933002: Add more fine-grained accessibility modes. (Closed)
Patch Set: Rename constants Created 4 years 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: content/common/accessibility_mode_enums.h
diff --git a/content/common/accessibility_mode_enums.h b/content/common/accessibility_mode_enums.h
index ae059f264140ebee1b496ba581f2e4d064405377..20b60250bddc5e4b780f212de6daa30bcf38a791 100644
--- a/content/common/accessibility_mode_enums.h
+++ b/content/common/accessibility_mode_enums.h
@@ -8,27 +8,61 @@
// Note: keep enums in content/browser/resources/accessibility/accessibility.js
// in sync with these two enums.
enum AccessibilityModeFlag {
- // Accessibility updates are processed to create platform trees and events are
- // passed to platform APIs in the browser.
- AccessibilityModeFlagPlatform = 1 << 0,
-
- // Accessibility is on, and the full tree is computed. If this flag is off,
- // only limited information about editable text nodes is sent to the browser
- // process. Useful for implementing limited UIA on tablets.
- AccessibilityModeFlagFullTree = 1 << 1,
aboxhall 2016/12/12 20:18:29 Did this comment become inaccurate?
dmazzoni 2016/12/12 22:15:36 Yeah, a while back we had an "EditableTextOnly" mo
-};
+ // Native accessibility APIs, specific to each platform, are enabled.
+ // When this flag is set that indicates the presence of a third-party
+ // client accessing Chrome via accessibility APIs. However, unless one
+ // of the flags below is set, the contents of web pages will not be
+ // accessible.
+ AccessibilityModeFlagNativeAPIs = 1 << 0,
+
+ // The renderer process will generate an accessibility tree containing
+ // basic information about all nodes, including role, name, value,
+ // state, and location. This is the minimum flag required in order for
+ // web contents to be accessible, and the remaining flags are meaningless
+ // unless this one is set.
+ //
+ // Note that sometimes this flag will be set when
+ // AccessibilityModeFlagNativeAPIs is not, when the content layer embedder
+ // is providing accessibility support via some other mechanism other than
+ // what's implemented in content/browser.
+ AccessibilityModeFlagWebContents = 1 << 1,
-enum AccessibilityMode {
- // All accessibility is off.
- AccessibilityModeOff = 0,
+ // The accessibility tree will contain inline text boxes, which are
+ // necessary to expose information about line breaks and word boundaries.
+ // Without this flag, you can retrieve the plaintext value of a text field
+ // but not the information about how it's broken down into lines.
+ //
+ // Note that when this flag is off it's still possible to request inline
+ // text boxes for a specific node on-demand, asynchronously.
+ AccessibilityModeFlagInlineTextBoxes = 1 << 2,
- // Renderer accessibility is on, and platform APIs are called.
- AccessibilityModeComplete =
- AccessibilityModeFlagPlatform | AccessibilityModeFlagFullTree,
+ // The accessibility tree will contain extra accessibility
+ // attributes typically only needed by screen readers and other
+ // assistive technology for blind users. Examples include text style
+ // attributes, table cell information, live region properties, range
+ // values, and relationship attributes.
+ AccessibilityModeFlagScreenReader = 1 << 3,
- // Renderer accessibility is on, and events are passed to any extensions
- // requesting automation, but not to platform accessibility.
- AccessibilityModeTreeOnly = AccessibilityModeFlagFullTree,
+ // The accessibility tree will contain the HTML tag name and HTML attributes
+ // for all accessibility nodes that come from web content.
+ AccessibilityModeFlagHTML = 1 << 4,
};
+typedef int AccessibilityMode;
+
+const AccessibilityMode AccessibilityModeOff = 0;
+
+const AccessibilityMode kAccessibilityModeComplete =
+ AccessibilityModeFlagNativeAPIs |
+ AccessibilityModeFlagWebContents |
+ AccessibilityModeFlagInlineTextBoxes |
+ AccessibilityModeFlagScreenReader |
+ AccessibilityModeFlagHTML;
+
+const AccessibilityMode kAccessibilityModeWebContentsOnly =
+ AccessibilityModeFlagWebContents |
+ AccessibilityModeFlagInlineTextBoxes |
+ AccessibilityModeFlagScreenReader |
+ AccessibilityModeFlagHTML;
+
#endif // CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_

Powered by Google App Engine
This is Rietveld 408576698