Commit 41b76ab8 authored by Josiah K's avatar Josiah K Committed by Chromium LUCI CQ

[Magnifier] Gate focus following toggle behind feature flag

Gate "Zoomed in screen follows keyboard focus" toggle in Chrome OS Accessibility settings behind feature flag MagnifierPanningImprovements. (following crbug.com/1144947, hide toggle in M89)

Feature off: https://screenshot.googleplex.com/8wTtrRRQCC4XNx5
Feature on: https://screenshot.googleplex.com/7RaUNBhcpQsgBeC

AX-Relnotes: N/A.
Fixed: 1165650
Change-Id: I8286f977a6099cdc31e82b536d09e5c291aac637
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622716
Auto-Submit: Josiah Krutz <josiahk@google.com>
Commit-Queue: Jimmy Gong <jimmyxgong@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarJimmy Gong <jimmyxgong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842681}
parent 60b1088e
......@@ -96,15 +96,17 @@
deep-link-focus-id$="[[Setting.kFullscreenMagnifier]]">
</settings-toggle-button>
<template is="dom-if" if="[[prefs.settings.a11y.screen_magnifier.value]]">
<div class="sub-item">
<settings-toggle-button
class="sub-item"
pref="{{prefs.settings.a11y.screen_magnifier_focus_following}}"
label="$i18n{screenMagnifierFocusFollowingLabel}"
deep-link-focus-id$=
"[[Setting.kFullscreenMagnifierFocusFollowing]]">
</settings-toggle-button>
</div>
<template is="dom-if" if="[[isMagnifierPanningImprovementsEnabled_]]">
<div class="sub-item">
<settings-toggle-button
class="sub-item"
pref="{{prefs.settings.a11y.screen_magnifier_focus_following}}"
label="$i18n{screenMagnifierFocusFollowingLabel}"
deep-link-focus-id$=
"[[Setting.kFullscreenMagnifierFocusFollowing]]">
</settings-toggle-button>
</div>
</template>
<div class="settings-box continuation">
<div class="start sub-item settings-box-text" aria-hidden="true">
$i18n{screenMagnifierZoomLabel}
......
......@@ -158,6 +158,14 @@ Polymer({
},
},
/** @private */
isMagnifierPanningImprovementsEnabled_: {
type: Boolean,
value() {
return loadTimeData.getBoolean('isMagnifierPanningImprovementsEnabled');
},
},
/**
* Whether the user is in kiosk mode.
* @private
......
......@@ -196,12 +196,6 @@ const std::vector<SearchConcept>& GetA11ySearchConcepts() {
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kFullscreenMagnifier}},
{IDS_OS_SETTINGS_TAG_A11Y_FULLSCREEN_MAGNIFIER_FOCUS_FOLLOWING,
mojom::kManageAccessibilitySubpagePath,
mojom::SearchResultIcon::kA11y,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kFullscreenMagnifierFocusFollowing}},
{IDS_OS_SETTINGS_TAG_A11Y_ENABLE_SWITCH_ACCESS,
mojom::kManageAccessibilitySubpagePath,
mojom::SearchResultIcon::kA11y,
......@@ -321,6 +315,19 @@ const std::vector<SearchConcept>& GetA11yCursorColorSearchConcepts() {
return *tags;
}
const std::vector<SearchConcept>&
GetA11yFullscreenMagnifierFocusFollowingSearchConcepts() {
static const base::NoDestructor<std::vector<SearchConcept>> tags({
{IDS_OS_SETTINGS_TAG_A11Y_FULLSCREEN_MAGNIFIER_FOCUS_FOLLOWING,
mojom::kManageAccessibilitySubpagePath,
mojom::SearchResultIcon::kA11y,
mojom::SearchResultDefaultRank::kMedium,
mojom::SearchResultType::kSetting,
{.setting = mojom::Setting::kFullscreenMagnifierFocusFollowing}},
});
return *tags;
}
bool AreExperimentalA11yLabelsAllowed() {
return base::FeatureList::IsEnabled(
::features::kExperimentalAccessibilityLabels);
......@@ -334,6 +341,10 @@ bool IsCursorColorAllowed() {
return features::IsAccessibilityCursorColorEnabled();
}
bool IsMagnifierPanningImprovementsEnabled() {
return features::IsMagnifierPanningImprovementsEnabled();
}
bool IsSwitchAccessTextAllowed() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
::switches::kEnableExperimentalAccessibilitySwitchAccessText);
......@@ -644,6 +655,9 @@ void AccessibilitySection::AddLoadTimeData(
html_source->AddBoolean("showExperimentalAccessibilityCursorColor",
IsCursorColorAllowed());
html_source->AddBoolean("isMagnifierPanningImprovementsEnabled",
IsMagnifierPanningImprovementsEnabled());
::settings::AddCaptionSubpageStrings(html_source);
}
......@@ -831,6 +845,14 @@ void AccessibilitySection::UpdateSearchTags() {
updater.RemoveSearchTags(GetA11yCursorColorSearchConcepts());
}
if (IsMagnifierPanningImprovementsEnabled()) {
updater.AddSearchTags(
GetA11yFullscreenMagnifierFocusFollowingSearchConcepts());
} else {
updater.RemoveSearchTags(
GetA11yFullscreenMagnifierFocusFollowingSearchConcepts());
}
if (!pref_service_->GetBoolean(
ash::prefs::kAccessibilitySwitchAccessEnabled)) {
return;
......
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