1 // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Define all the base::Features used by ui/accessibility. 6 #ifndef UI_ACCESSIBILITY_ACCESSIBILITY_FEATURES_H_ 7 #define UI_ACCESSIBILITY_ACCESSIBILITY_FEATURES_H_ 8 9 #include "base/feature_list.h" 10 #include "build/build_config.h" 11 #include "ui/accessibility/ax_base_export.h" 12 13 namespace features { 14 15 AX_BASE_EXPORT extern const base::Feature kEnableAccessibilityExposeDisplayNone; 16 17 // Returns true if "display: none" nodes should be exposed to the 18 // browser process AXTree. 19 AX_BASE_EXPORT bool IsAccessibilityExposeDisplayNoneEnabled(); 20 21 AX_BASE_EXPORT extern const base::Feature kEnableAccessibilityExposeHTMLElement; 22 23 // Returns true if the <html> element should be exposed to the 24 // browser process AXTree (as an ignored node). 25 AX_BASE_EXPORT bool IsAccessibilityExposeHTMLElementEnabled(); 26 27 AX_BASE_EXPORT extern const base::Feature 28 kEnableAccessibilityExposeIgnoredNodes; 29 30 // Returns true if all ignored nodes are exposed by Blink in the 31 // accessibility tree. 32 AX_BASE_EXPORT bool IsAccessibilityExposeIgnoredNodesEnabled(); 33 34 AX_BASE_EXPORT extern const base::Feature kEnableAccessibilityLanguageDetection; 35 36 // Return true if language detection should be used to determine the language 37 // of text content in page and exposed to the browser process AXTree. 38 AX_BASE_EXPORT bool IsAccessibilityLanguageDetectionEnabled(); 39 40 // Serializes accessibility information from the Views tree and deserializes it 41 // into an AXTree in the browser process. 42 AX_BASE_EXPORT extern const base::Feature kEnableAccessibilityTreeForViews; 43 44 // Returns true if the Views tree is exposed using an AXTree in the browser 45 // process. Returns false if the Views tree is exposed to accessibility 46 // directly. 47 AX_BASE_EXPORT bool IsAccessibilityTreeForViewsEnabled(); 48 49 AX_BASE_EXPORT extern const base::Feature kAccessibilityFocusHighlight; 50 51 // Returns true if the accessibility focus highlight feature is enabled, 52 // which draws a visual highlight around the focused element on the page 53 // briefly whenever focus changes. 54 AX_BASE_EXPORT bool IsAccessibilityFocusHighlightEnabled(); 55 56 #if defined(OS_WIN) 57 // Enables an experimental Chrome-specific accessibility COM API 58 AX_BASE_EXPORT extern const base::Feature kIChromeAccessible; 59 60 // Returns true if the IChromeAccessible COM API is enabled. 61 AX_BASE_EXPORT bool IsIChromeAccessibleEnabled(); 62 63 #endif // defined(OS_WIN) 64 65 #if defined(OS_CHROMEOS) 66 AX_BASE_EXPORT extern const base::Feature kAccessibilityCursorColor; 67 68 // Returns true if the accessibility cursor color feature is enabled, letting 69 // users pick a custom cursor color. 70 AX_BASE_EXPORT bool IsAccessibilityCursorColorEnabled(); 71 72 // Enables new magnifier focus following feature, which provides a richer 73 // focus following experience. 74 AX_BASE_EXPORT extern const base::Feature kMagnifierNewFocusFollowing; 75 76 // Returns true if the new magnifier focus following feature is enabled. 77 AX_BASE_EXPORT bool IsMagnifierNewFocusFollowingEnabled(); 78 #endif // defined(OS_CHROMEOS) 79 80 // Enables Get Image Descriptions to augment existing images labels, 81 // rather than only provide descriptions for completely unlabeled images. 82 AX_BASE_EXPORT extern const base::Feature kAugmentExistingImageLabels; 83 84 // Returns true if augmenting existing image labels is enabled. 85 AX_BASE_EXPORT bool IsAugmentExistingImageLabelsEnabled(); 86 87 // Once this flag is enabled, a single codebase in AXPosition will be used for 88 // handling document markers on all platforms, including the announcement of 89 // spelling mistakes. 90 AX_BASE_EXPORT extern const base::Feature kUseAXPositionForDocumentMarkers; 91 92 // Returns true if document markers are exposed on inline text boxes in the 93 // accessibility tree in addition to on static text nodes. This in turn enables 94 // AXPosition on the browser to discover and work with document markers, instead 95 // of the legacy code that collects document markers manually from static text 96 // nodes and which is different for each platform. 97 AX_BASE_EXPORT bool IsUseAXPositionForDocumentMarkersEnabled(); 98 99 #if defined(OS_CHROMEOS) 100 // Enables enhanced Select-to-speak features that allow users broader control 101 // of TTS (pause, resume, skip between sentences and paragraphs). 102 AX_BASE_EXPORT extern const base::Feature kSelectToSpeakNavigationControl; 103 104 // Returns true if enhanced Select-to-speak features are enabled. 105 AX_BASE_EXPORT bool IsSelectToSpeakNavigationControlEnabled(); 106 #endif // defined(OS_CHROMEOS) 107 108 } // namespace features 109 110 #endif // UI_ACCESSIBILITY_ACCESSIBILITY_FEATURES_H_ 111