Commit 3a473747 authored by Josiah K's avatar Josiah K Committed by Commit Bot

Gate new MoveMagnifierToRect API on MagnifierNewFocusFollowing switch

Fixed: 1139200
Change-Id: I7f87a0d8dd9e5284525b256da86dfa4334af5de7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2478145
Commit-Queue: Josiah Krutz <josiahk@google.com>
Auto-Submit: Josiah Krutz <josiahk@google.com>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818115}
parent 5416c833
...@@ -416,6 +416,10 @@ AccessibilityPrivateMoveMagnifierToRectFunction::Run() { ...@@ -416,6 +416,10 @@ AccessibilityPrivateMoveMagnifierToRectFunction::Run() {
std::unique_ptr<accessibility_private::MoveMagnifierToRect::Params> params = std::unique_ptr<accessibility_private::MoveMagnifierToRect::Params> params =
accessibility_private::MoveMagnifierToRect::Params::Create(*args_); accessibility_private::MoveMagnifierToRect::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params); EXTENSION_FUNCTION_VALIDATE(params);
if (!::switches::
IsExperimentalAccessibilityMagnifierNewFocusFollowingEnabled()) {
return RespondNow(NoArguments());
}
accessibility_private::ScreenRect rect = std::move(params->rect); accessibility_private::ScreenRect rect = std::move(params->rect);
gfx::Rect bounds(rect.left, rect.top, rect.width, rect.height); gfx::Rect bounds(rect.left, rect.top, rect.width, rect.height);
......
...@@ -64,6 +64,11 @@ bool IsExperimentalAccessibilitySwitchAccessTextEnabled() { ...@@ -64,6 +64,11 @@ bool IsExperimentalAccessibilitySwitchAccessTextEnabled() {
::switches::kEnableExperimentalAccessibilitySwitchAccessText); ::switches::kEnableExperimentalAccessibilitySwitchAccessText);
} }
bool IsExperimentalAccessibilityMagnifierNewFocusFollowingEnabled() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
::switches::kEnableExperimentalAccessibilityMagnifierNewFocusFollowing);
}
bool IsSwitchAccessPointScanningEnabled() { bool IsSwitchAccessPointScanningEnabled() {
return base::CommandLine::ForCurrentProcess()->HasSwitch( return base::CommandLine::ForCurrentProcess()->HasSwitch(
::switches::kEnableSwitchAccessPointScanning); ::switches::kEnableSwitchAccessPointScanning);
......
...@@ -39,6 +39,11 @@ IsExperimentalAccessibilityLanguageDetectionDynamicEnabled(); ...@@ -39,6 +39,11 @@ IsExperimentalAccessibilityLanguageDetectionDynamicEnabled();
// Returns true if experimental accessibility Switch Access text is enabled. // Returns true if experimental accessibility Switch Access text is enabled.
AX_BASE_EXPORT bool IsExperimentalAccessibilitySwitchAccessTextEnabled(); AX_BASE_EXPORT bool IsExperimentalAccessibilitySwitchAccessTextEnabled();
// Returns true if experimental accessibility Magnifier new focus following is
// enabled.
AX_BASE_EXPORT bool
IsExperimentalAccessibilityMagnifierNewFocusFollowingEnabled();
#if defined(OS_WIN) #if defined(OS_WIN)
AX_BASE_EXPORT extern const char kEnableExperimentalUIAutomation[]; AX_BASE_EXPORT extern const char kEnableExperimentalUIAutomation[];
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment