accessibility_switches.cc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #include "ui/accessibility/accessibility_switches.h"
  5. #include "base/command_line.h"
  6. #include "build/build_config.h"
  7. namespace switches {
  8. // Shows additional automatic click features that haven't launched yet.
  9. const char kEnableExperimentalAccessibilityAutoclick[] =
  10. "enable-experimental-accessibility-autoclick";
  11. // Enables support for visually debugging the accessibility labels
  12. // feature, which provides images descriptions for screen reader users.
  13. const char kEnableExperimentalAccessibilityLabelsDebugging[] =
  14. "enable-experimental-accessibility-labels-debugging";
  15. // Enables language detection on in-page text content which is then exposed to
  16. // assistive technology such as screen readers.
  17. const char kEnableExperimentalAccessibilityLanguageDetection[] =
  18. "enable-experimental-accessibility-language-detection";
  19. // Enables language detection for dynamic content which is then exposed to
  20. // assistive technology such as screen readers.
  21. const char kEnableExperimentalAccessibilityLanguageDetectionDynamic[] =
  22. "enable-experimental-accessibility-language-detection-dynamic";
  23. // Enables in progress Switch Access features for text input.
  24. const char kEnableExperimentalAccessibilitySwitchAccessText[] =
  25. "enable-experimental-accessibility-switch-access-text";
  26. // Enables debug feature for drawing rectangle around magnified region, without
  27. // zooming in.
  28. const char kEnableMagnifierDebugDrawRect[] = "enable-magnifier-debug-draw-rect";
  29. bool IsExperimentalAccessibilityLanguageDetectionEnabled() {
  30. return base::CommandLine::ForCurrentProcess()->HasSwitch(
  31. ::switches::kEnableExperimentalAccessibilityLanguageDetection);
  32. }
  33. bool IsExperimentalAccessibilityLanguageDetectionDynamicEnabled() {
  34. return base::CommandLine::ForCurrentProcess()->HasSwitch(
  35. ::switches::kEnableExperimentalAccessibilityLanguageDetectionDynamic);
  36. }
  37. bool IsExperimentalAccessibilitySwitchAccessTextEnabled() {
  38. return base::CommandLine::ForCurrentProcess()->HasSwitch(
  39. ::switches::kEnableExperimentalAccessibilitySwitchAccessText);
  40. }
  41. bool IsMagnifierDebugDrawRectEnabled() {
  42. return base::CommandLine::ForCurrentProcess()->HasSwitch(
  43. ::switches::kEnableMagnifierDebugDrawRect);
  44. }
  45. #if BUILDFLAG(IS_WIN)
  46. // Enables UI Automation platform API in addition to the IAccessible API.
  47. const char kEnableExperimentalUIAutomation[] =
  48. "enable-experimental-ui-automation";
  49. #endif
  50. bool IsExperimentalAccessibilityPlatformUIAEnabled() {
  51. #if BUILDFLAG(IS_WIN)
  52. return base::CommandLine::ForCurrentProcess()->HasSwitch(
  53. ::switches::kEnableExperimentalUIAutomation);
  54. #else
  55. return false;
  56. #endif
  57. }
  58. // Optionally disable AXMenuList, which makes the internal pop-up menu
  59. // UI for a select element directly accessible.
  60. const char kDisableAXMenuList[] = "disable-ax-menu-list";
  61. const char kGenerateAccessibilityTestExpectations[] =
  62. "generate-accessibility-test-expectations";
  63. } // namespace switches