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

Side by Side Diff: content/common/accessibility_mode_enums.h

Issue 2558933002: Add more fine-grained accessibility modes. (Closed)
Patch Set: Reformat enums as uppercase 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 unified diff | Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 ACCESSIBILITY_MODE_FLAG_NATIVE_APIS = 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
22 // unless this one is set.
23 //
24 // Note that sometimes this flag will be set when
25 // ACCESSIBILITY_MODE_FLAG_NATIVE_APIS 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 ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS = 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 ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES = 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 ACCESSIBILITY_MODE_FLAG_SCREEN_READER = 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 ACCESSIBILITY_MODE_FLAG_HTML = 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 ACCESSIBILITY_MODE_COMPLETE =
30 // requesting automation, but not to platform accessibility. 56 ACCESSIBILITY_MODE_FLAG_NATIVE_APIS |
31 AccessibilityModeTreeOnly = AccessibilityModeFlagFullTree, 57 ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS |
32 }; 58 ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES |
59 ACCESSIBILITY_MODE_FLAG_SCREEN_READER |
60 ACCESSIBILITY_MODE_FLAG_HTML;
61
62 const AccessibilityMode ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY =
63 ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS |
64 ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES |
65 ACCESSIBILITY_MODE_FLAG_SCREEN_READER |
66 ACCESSIBILITY_MODE_FLAG_HTML;
33 67
34 #endif // CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_ 68 #endif // CONTENT_COMMON_ACCESSIBILITY_MODE_ENUMS_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698