1 // Copyright (c) 2018 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 #include "ui/accessibility/accessibility_switches.h"
6 
7 #include "base/command_line.h"
8 #include "build/build_config.h"
9 
10 namespace switches {
11 
12 // Shows additional automatic click features that haven't launched yet.
13 const char kEnableExperimentalAccessibilityAutoclick[] =
14     "enable-experimental-accessibility-autoclick";
15 
16 // Enables support for visually debugging the accessibility labels
17 // feature, which provides images descriptions for screen reader users.
18 const char kEnableExperimentalAccessibilityLabelsDebugging[] =
19     "enable-experimental-accessibility-labels-debugging";
20 
21 // Enables language detection on in-page text content which is then exposed to
22 // assistive technology such as screen readers.
23 const char kEnableExperimentalAccessibilityLanguageDetection[] =
24     "enable-experimental-accessibility-language-detection";
25 
26 // Enables language detection for dynamic content which is then exposed to
27 // assistive technology such as screen readers.
28 const char kEnableExperimentalAccessibilityLanguageDetectionDynamic[] =
29     "enable-experimental-accessibility-language-detection-dynamic";
30 
31 // Enables in progress Switch Access features for text input.
32 const char kEnableExperimentalAccessibilitySwitchAccessText[] =
33     "enable-experimental-accessibility-switch-access-text";
34 
35 // Enables annotations feature that hasn't launched yet.
36 const char kEnableExperimentalAccessibilityChromeVoxAnnotations[] =
37     "enable-experimental-accessibility-chromevox-annotations";
38 
39 // Enables Switch Access point scanning. This feature hasn't launched yet.
40 const char kEnableSwitchAccessPointScanning[] =
41     "enable-switch-access-point-scanning";
42 
IsExperimentalAccessibilityLanguageDetectionEnabled()43 bool IsExperimentalAccessibilityLanguageDetectionEnabled() {
44   return base::CommandLine::ForCurrentProcess()->HasSwitch(
45       ::switches::kEnableExperimentalAccessibilityLanguageDetection);
46 }
47 
IsExperimentalAccessibilityLanguageDetectionDynamicEnabled()48 bool IsExperimentalAccessibilityLanguageDetectionDynamicEnabled() {
49   return base::CommandLine::ForCurrentProcess()->HasSwitch(
50       ::switches::kEnableExperimentalAccessibilityLanguageDetectionDynamic);
51 }
52 
IsExperimentalAccessibilitySwitchAccessTextEnabled()53 bool IsExperimentalAccessibilitySwitchAccessTextEnabled() {
54   return base::CommandLine::ForCurrentProcess()->HasSwitch(
55       ::switches::kEnableExperimentalAccessibilitySwitchAccessText);
56 }
57 
IsSwitchAccessPointScanningEnabled()58 bool IsSwitchAccessPointScanningEnabled() {
59   return base::CommandLine::ForCurrentProcess()->HasSwitch(
60       ::switches::kEnableSwitchAccessPointScanning);
61 }
62 
63 #if defined(OS_WIN)
64 // Enables UI Automation platform API in addition to the IAccessible API.
65 const char kEnableExperimentalUIAutomation[] =
66     "enable-experimental-ui-automation";
67 #endif
68 
IsExperimentalAccessibilityPlatformUIAEnabled()69 bool IsExperimentalAccessibilityPlatformUIAEnabled() {
70 #if defined(OS_WIN)
71   return base::CommandLine::ForCurrentProcess()->HasSwitch(
72       ::switches::kEnableExperimentalUIAutomation);
73 #else
74   return false;
75 #endif
76 }
77 
78 // Optionally disable AXMenuList, which makes the internal pop-up menu
79 // UI for a select element directly accessible.
80 const char kDisableAXMenuList[] = "disable-ax-menu-list";
81 
82 }  // namespace switches
83