Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_ | 5 #ifndef CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_ |
| 6 #define CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_ | 6 #define CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_ |
| 7 | 7 |
| 8 // Note: keep enums in content/browser/resources/accessibility/accessibility.js | 8 // Note: keep enums in content/browser/resources/accessibility/accessibility.js |
| 9 // in sync with these two enums. | 9 // in sync with these two enums. |
| 10 enum AccessibilityModeFlag { | 10 enum AccessibilityModeFlag { |
| 11 // Accessibility updates are processed to create platform trees and events are | 11 // Native accessibility APIs, specific to each platform, are enabled. |
| 12 // passed to platform APIs in the browser. | 12 // When this flag is set that indicates the presence of a third-party |
| 13 AccessibilityModeFlagPlatform = 1 << 0, | 13 // client accessing Chrome via accessibility APIs. However, unless one |
| 14 // of the flags below is set, the contents of web pages will not be | |
| 15 // accessible. | |
| 16 AccessibilityModeFlagNativeAPIs = 1 << 0, | |
| 14 | 17 |
| 15 // Accessibility is on, and the full tree is computed. If this flag is off, | 18 // The renderer process will generate an accessibility tree containing |
| 16 // only limited information about editable text nodes is sent to the browser | 19 // basic information about all nodes, including role, name, value, |
| 17 // process. Useful for implementing limited UIA on tablets. | 20 // state, and location. This is the minimum flag required in order for |
| 18 AccessibilityModeFlagFullTree = 1 << 1, | 21 // web contents to be accessible, and the remaining flags are meaningless |
|
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
| |
| 22 // unless this one is set. | |
| 23 // | |
| 24 // Note that sometimes this flag will be set when | |
| 25 // AccessibilityModeFlagNativeAPIs is not, when the content layer embedder | |
| 26 // is providing accessibility support via some other mechanism other than | |
| 27 // what's implemented in content/browser. | |
| 28 AccessibilityModeFlagWebContents = 1 << 1, | |
| 29 | |
| 30 // The accessibility tree will contain inline text boxes, which are | |
| 31 // necessary to expose information about line breaks and word boundaries. | |
| 32 // Without this flag, you can retrieve the plaintext value of a text field | |
| 33 // but not the information about how it's broken down into lines. | |
| 34 // | |
| 35 // Note that when this flag is off it's still possible to request inline | |
| 36 // text boxes for a specific node on-demand, asynchronously. | |
| 37 AccessibilityModeFlagInlineTextBoxes = 1 << 2, | |
| 38 | |
| 39 // The accessibility tree will contain extra accessibility | |
| 40 // attributes typically only needed by screen readers and other | |
| 41 // assistive technology for blind users. Examples include text style | |
| 42 // attributes, table cell information, live region properties, range | |
| 43 // values, and relationship attributes. | |
| 44 AccessibilityModeFlagScreenReader = 1 << 3, | |
| 45 | |
| 46 // The accessibility tree will contain the HTML tag name and HTML attributes | |
| 47 // for all accessibility nodes that come from web content. | |
| 48 AccessibilityModeFlagHTML = 1 << 4, | |
| 19 }; | 49 }; |
| 20 | 50 |
| 21 enum AccessibilityMode { | 51 typedef int AccessibilityMode; |
| 22 // All accessibility is off. | |
| 23 AccessibilityModeOff = 0, | |
| 24 | 52 |
| 25 // Renderer accessibility is on, and platform APIs are called. | 53 const AccessibilityMode AccessibilityModeOff = 0; |
| 26 AccessibilityModeComplete = | |
| 27 AccessibilityModeFlagPlatform | AccessibilityModeFlagFullTree, | |
| 28 | 54 |
| 29 // Renderer accessibility is on, and events are passed to any extensions | 55 const AccessibilityMode kAccessibilityModeComplete = |
| 30 // requesting automation, but not to platform accessibility. | 56 AccessibilityModeFlagNativeAPIs | |
| 31 AccessibilityModeTreeOnly = AccessibilityModeFlagFullTree, | 57 AccessibilityModeFlagWebContents | |
| 32 }; | 58 AccessibilityModeFlagInlineTextBoxes | |
| 59 AccessibilityModeFlagScreenReader | | |
| 60 AccessibilityModeFlagHTML; | |
| 61 | |
| 62 const AccessibilityMode kAccessibilityModeWebContentsOnly = | |
| 63 AccessibilityModeFlagWebContents | | |
| 64 AccessibilityModeFlagInlineTextBoxes | | |
| 65 AccessibilityModeFlagScreenReader | | |
| 66 AccessibilityModeFlagHTML; | |
| 33 | 67 |
| 34 #endif // CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_ | 68 #endif // CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_ |
| OLD | NEW |