[A11y][Kiosk] Inline Kiosk Accessibility Page
Inline ChromeOS Accessibility page in Kiosk Mode with links to revamped subpages. Before: https://screenshot.googleplex.com/3uzcHQbBwJXFog3 After: https://screenshot.googleplex.com/82PsZAmK57nbyTP Fixed: b/259370808 AX-Relnotes: Replace Long Accessibility page in Kiosk Mode with links to revamped subpages. Change-Id: I16373e7dc3e74f9ab671254731a88d002dc3cd4b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4698054 Reviewed-by: Wes Okuhara <wesokuhara@google.com> Auto-Submit: Josiah Krutz <josiahk@google.com> Reviewed-by: Katie Dektar <katie@chromium.org> Commit-Queue: Wes Okuhara <wesokuhara@google.com> Cr-Commit-Position: refs/heads/main@{#1178056}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
0b7cde600f
commit
07abfcc4d3
chrome
browser
resources
test
data
webui
settings
docs/accessibility/os
@ -176,7 +176,6 @@ build_webui("build") {
|
||||
"os_a11y_page/display_and_magnification_subpage.ts",
|
||||
"os_a11y_page/keyboard_and_text_input_page.ts",
|
||||
"os_a11y_page/live_caption_section.ts",
|
||||
"os_a11y_page/manage_a11y_subpage.ts",
|
||||
"os_a11y_page/os_a11y_page.ts",
|
||||
"os_a11y_page/select_to_speak_subpage.ts",
|
||||
"os_a11y_page/switch_access_action_assignment_dialog.ts",
|
||||
@ -356,7 +355,6 @@ build_webui("build") {
|
||||
"os_a11y_page/audio_and_captions_page_browser_proxy.ts",
|
||||
"os_a11y_page/cursor_and_touchpad_page_browser_proxy.ts",
|
||||
"os_a11y_page/keyboard_and_text_input_page_browser_proxy.ts",
|
||||
"os_a11y_page/manage_a11y_subpage_browser_proxy.ts",
|
||||
"os_a11y_page/os_a11y_page_browser_proxy.ts",
|
||||
"os_a11y_page/switch_access_constants.ts",
|
||||
"os_a11y_page/switch_access_subpage_browser_proxy.ts",
|
||||
|
@ -30,7 +30,6 @@ import './internet_page/internet_known_networks_subpage.js';
|
||||
import './internet_page/internet_subpage.js';
|
||||
import './internet_page/passpoint_subpage.js';
|
||||
import './kerberos_page/kerberos_accounts_subpage.js';
|
||||
import './os_a11y_page/manage_a11y_subpage.js';
|
||||
import './os_a11y_page/display_and_magnification_subpage.js';
|
||||
import './os_a11y_page/keyboard_and_text_input_page.js';
|
||||
import './os_a11y_page/cursor_and_touchpad_page.js';
|
||||
@ -166,7 +165,6 @@ export {SettingsChromeVoxSubpageElement} from './os_a11y_page/chromevox_subpage.
|
||||
export {SettingsCursorAndTouchpadPageElement} from './os_a11y_page/cursor_and_touchpad_page.js';
|
||||
export {SettingsDisplayAndMagnificationSubpageElement} from './os_a11y_page/display_and_magnification_subpage.js';
|
||||
export {SettingsKeyboardAndTextInputPageElement} from './os_a11y_page/keyboard_and_text_input_page.js';
|
||||
export {SettingsManageA11ySubpageElement} from './os_a11y_page/manage_a11y_subpage.js';
|
||||
export {HandlerVoice, SettingsSelectToSpeakSubpageElement} from './os_a11y_page/select_to_speak_subpage.js';
|
||||
export {SettingsSwitchAccessActionAssignmentDialogElement} from './os_a11y_page/switch_access_action_assignment_dialog.js';
|
||||
export {SwitchAccessCommand} from './os_a11y_page/switch_access_constants.js';
|
||||
|
@ -1,431 +0,0 @@
|
||||
<style include="settings-shared">
|
||||
h2 {
|
||||
padding-inline-start: var(--cr-section-padding);
|
||||
}
|
||||
|
||||
.sub-item {
|
||||
margin-inline-start: var(--cr-section-indent-width);
|
||||
}
|
||||
|
||||
h2 ~ .settings-box,
|
||||
h2 ~ settings-toggle-button,
|
||||
h2 ~ cr-link-row,
|
||||
iron-collapse .settings-box,
|
||||
iron-collapse settings-toggle-button,
|
||||
iron-collapse cr-link-row {
|
||||
margin-inline-end: var(--cr-section-padding);
|
||||
margin-inline-start: var(--cr-section-indent-padding);
|
||||
padding-inline-end: 0;
|
||||
padding-inline-start: 0;
|
||||
}
|
||||
|
||||
.settings-box.indented,
|
||||
settings-toggle-button.indented {
|
||||
margin-inline-start: calc(var(--cr-section-indent-padding) +
|
||||
var(--cr-section-indent-width));
|
||||
}
|
||||
|
||||
#screenMagnifierZoomHintLabel {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
#dictationLocaleMenuSubtitle {
|
||||
max-width: 450px;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
<template is="dom-if" if="[[!isKioskModeActive_]]">
|
||||
<div class="settings-box row first">
|
||||
<localized-link
|
||||
localized-string="$i18n{a11yExplanation}"
|
||||
link-url="$i18nRaw{a11yLearnMoreUrl}">
|
||||
</localized-link>
|
||||
</div>
|
||||
</template>
|
||||
<h2>$i18n{textToSpeechHeading}</h2>
|
||||
<settings-toggle-button
|
||||
pref="{{prefs.settings.accessibility}}"
|
||||
label="$i18n{chromeVoxLabel}"
|
||||
sub-label="[[getChromeVoxDescription_(prefs.settings.accessibility.value)]]"
|
||||
deep-link-focus-id$="[[Setting.kChromeVox]]">
|
||||
</settings-toggle-button>
|
||||
<iron-collapse opened="[[prefs.settings.accessibility.value]]">
|
||||
<!-- TODO(b/270557583): Update link to point to new ChromeVox Settings Page
|
||||
(when AccessibilityChromeVoxPageMigration flag enabled)-->
|
||||
<div class="sub-item">
|
||||
<template is="dom-if"
|
||||
if="[[isAccessibilityChromeVoxPageMigrationEnabled_]]">
|
||||
<cr-link-row id="chromevoxSubpageTrigger"
|
||||
class="settings-box" on-click="onChromeVoxNewSettingsClick_"
|
||||
label="$i18n{chromeVoxOptionsLabel}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
</template>
|
||||
<template is="dom-if"
|
||||
if="[[!isAccessibilityChromeVoxPageMigrationEnabled_]]">
|
||||
<cr-link-row id="chromeVoxSubpageButton"
|
||||
class="settings-box" on-click="onChromeVoxSettingsClick_"
|
||||
label="$i18n{chromeVoxOptionsLabel}"
|
||||
external>
|
||||
</cr-link-row>
|
||||
</template>
|
||||
</div>
|
||||
<div class="sub-item">
|
||||
<cr-link-row id="chromeVoxTutorialButton"
|
||||
class="settings-box" on-click="onChromeVoxTutorialClick_"
|
||||
label="$i18n{chromeVoxTutorialLabel}"
|
||||
external>
|
||||
</cr-link-row>
|
||||
</div>
|
||||
</iron-collapse>
|
||||
<settings-toggle-button
|
||||
pref="{{prefs.settings.a11y.select_to_speak}}"
|
||||
class="hr"
|
||||
label="$i18n{selectToSpeakTitle}"
|
||||
sub-label="[[getSelectToSpeakDescription_(
|
||||
prefs.settings.a11y.select_to_speak.value, hasKeyboard_)]]"
|
||||
deep-link-focus-id$="[[Setting.kSelectToSpeak]]">
|
||||
</settings-toggle-button>
|
||||
<iron-collapse opened="[[prefs.settings.a11y.select_to_speak.value]]">
|
||||
<div class="sub-item">
|
||||
<cr-link-row id="selectToSpeakSubpageTrigger"
|
||||
class="settings-box" on-click="onSelectToSpeakNewSettingsClick_"
|
||||
label="$i18n{selectToSpeakLinkTitle}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
</div>
|
||||
</iron-collapse>
|
||||
|
||||
<cr-link-row id="ttsSubpageButton" class="hr"
|
||||
label="$i18n{manageTtsSettings}" on-click="onManageTtsSettingsClick_"
|
||||
sub-label="$i18n{ttsSettingsLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}" embedded>
|
||||
</cr-link-row>
|
||||
|
||||
<h2>$i18n{displayHeading}</h2>
|
||||
<settings-toggle-button
|
||||
pref="{{prefs.settings.a11y.high_contrast_enabled}}"
|
||||
label="$i18n{highContrastLabel}"
|
||||
sub-label="$i18n{highContrastDescription}"
|
||||
deep-link-focus-id$="[[Setting.kHighContrastMode]]">
|
||||
</settings-toggle-button>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.screen_magnifier}}"
|
||||
label="$i18n{screenMagnifierLabel}"
|
||||
sub-label="[[getScreenMagnifierDescription_(
|
||||
prefs.settings.a11y.screen_magnifier.value)]]"
|
||||
disabled="[[prefs.ash.docked_magnifier.enabled.value]]"
|
||||
deep-link-focus-id$="[[Setting.kFullscreenMagnifier]]">
|
||||
</settings-toggle-button>
|
||||
<template is="dom-if" if="[[prefs.settings.a11y.screen_magnifier.value]]">
|
||||
<div class="settings-box continuation">
|
||||
<settings-radio-group id="screenMagnifierMouseFollowingModeRadioGroup"
|
||||
pref="{{prefs.settings.a11y.screen_magnifier_mouse_following_mode}}"
|
||||
class="sub-item">
|
||||
<controlled-radio-button
|
||||
id="screenMagnifierMouseFollowingModeContinuous"
|
||||
name="[[screenMagnifierMouseFollowingModePrefValues_.CONTINUOUS]]"
|
||||
pref="[[prefs.settings.a11y.screen_magnifier_mouse_following_mode]]"
|
||||
label="$i18n{screenMagnifierMouseFollowingModeContinuous}">
|
||||
</controlled-radio-button>
|
||||
<controlled-radio-button
|
||||
id="screenMagnifierMouseFollowingModeCentered"
|
||||
name="[[screenMagnifierMouseFollowingModePrefValues_.CENTERED]]"
|
||||
pref="[[prefs.settings.a11y.screen_magnifier_mouse_following_mode]]"
|
||||
label="$i18n{screenMagnifierMouseFollowingModeCentered}">
|
||||
</controlled-radio-button>
|
||||
<controlled-radio-button
|
||||
id="screenMagnifierMouseFollowingModeEdge"
|
||||
name="[[screenMagnifierMouseFollowingModePrefValues_.EDGE]]"
|
||||
pref="[[prefs.settings.a11y.screen_magnifier_mouse_following_mode]]"
|
||||
label="$i18n{screenMagnifierMouseFollowingModeEdge}">
|
||||
</controlled-radio-button>
|
||||
</settings-radio-group>
|
||||
</div>
|
||||
<settings-toggle-button
|
||||
class="indented hr"
|
||||
pref="{{prefs.settings.a11y.screen_magnifier_focus_following}}"
|
||||
label="$i18n{screenMagnifierFocusFollowingLabel}"
|
||||
deep-link-focus-id$=
|
||||
"[[Setting.kFullscreenMagnifierFocusFollowing]]">
|
||||
</settings-toggle-button>
|
||||
<div class="settings-box indented">
|
||||
<div class="flex start settings-box-text" id="labelWrapper">
|
||||
<div class="label" aria-hidden="true">
|
||||
$i18n{screenMagnifierZoomLabel}
|
||||
</div>
|
||||
<!-- Next line long because screenMagnifierZoomHintLabel uses pre-line -->
|
||||
<div id="screenMagnifierZoomHintLabel" class="secondary label">$i18n{screenMagnifierZoomHintLabel}</div>
|
||||
</div>
|
||||
<settings-dropdown-menu label="$i18n{screenMagnifierZoomLabel}"
|
||||
pref="{{prefs.settings.a11y.screen_magnifier_scale}}"
|
||||
menu-options="[[screenMagnifierZoomOptions_]]"
|
||||
disabled="[[!prefs.settings.a11y.screen_magnifier.value]]">
|
||||
</settings-dropdown-menu>
|
||||
</div>
|
||||
</template>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.ash.docked_magnifier.enabled}}"
|
||||
label="$i18n{dockedMagnifierLabel}"
|
||||
sub-label="$i18n{dockedMagnifierDescription}"
|
||||
disabled="[[prefs.settings.a11y.screen_magnifier.value]]"
|
||||
deep-link-focus-id$="[[Setting.kDockedMagnifier]]">
|
||||
</settings-toggle-button>
|
||||
<template is="dom-if" if="[[prefs.ash.docked_magnifier.enabled.value]]">
|
||||
<div class="settings-box continuation">
|
||||
<div class="start sub-item settings-box-text" aria-hidden="true">
|
||||
$i18n{dockedMagnifierZoomLabel}
|
||||
</div>
|
||||
<settings-dropdown-menu label="$i18n{dockedMagnifierZoomLabel}"
|
||||
pref="{{prefs.ash.docked_magnifier.scale}}"
|
||||
menu-options="[[screenMagnifierZoomOptions_]]"
|
||||
disabled="[[!prefs.ash.docked_magnifier.enabled.value]]">
|
||||
</settings-dropdown-menu>
|
||||
</div>
|
||||
</template>
|
||||
<template is="dom-if" if="[[!isKioskModeActive_]]">
|
||||
<cr-link-row id="displaySubpageButton" class="hr"
|
||||
label="$i18n{displaySettingsTitle}" on-click="onDisplayClick_"
|
||||
sub-label="$i18n{displaySettingsDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}" embedded>
|
||||
</cr-link-row>
|
||||
<cr-link-row id="appearanceSubpageButton" class="hr"
|
||||
label="$i18n{appearanceSettingsTitle}" on-click="onAppearanceClick_"
|
||||
sub-label="$i18n{appearanceSettingsDescription}"
|
||||
external
|
||||
embedded>
|
||||
</cr-link-row>
|
||||
</template>
|
||||
|
||||
<h2>$i18n{keyboardAndTextInputHeading}</h2>
|
||||
<settings-toggle-button
|
||||
pref="{{prefs.settings.a11y.sticky_keys_enabled}}"
|
||||
label="$i18n{stickyKeysLabel}"
|
||||
sub-label="$i18n{stickyKeysDescription}"
|
||||
deep-link-focus-id$="[[Setting.kStickyKeys]]">
|
||||
</settings-toggle-button>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.virtual_keyboard}}"
|
||||
label="$i18n{onScreenKeyboardLabel}"
|
||||
sub-label="$i18n{onScreenKeyboardDescription}"
|
||||
deep-link-focus-id$="[[Setting.kOnScreenKeyboard]]">
|
||||
</settings-toggle-button>
|
||||
<settings-toggle-button
|
||||
id="enableDictation"
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.dictation}}"
|
||||
label="$i18n{dictationLabel}"
|
||||
sub-label="$i18n{dictationDescription}"
|
||||
deep-link-focus-id$="[[Setting.kDictation]]"
|
||||
learn-more-url="[[dictationLearnMoreUrl_]]">
|
||||
</settings-toggle-button>
|
||||
<template is="dom-if" if="[[prefs.settings.a11y.dictation.value]]">
|
||||
<div class="settings-box continuation indented">
|
||||
<div class="flex start settings-box-text" id="labelWrapper">
|
||||
<div class="label" aria-hidden="true" id="dictationLocaleMenuLabel">
|
||||
$i18n{dictationLocaleMenuLabel}
|
||||
</div>
|
||||
<div class="secondary label" id="dictationLocaleMenuSubtitle">
|
||||
[[dictationLocaleMenuSubtitle_]]
|
||||
</div>
|
||||
</div>
|
||||
<cr-button
|
||||
on-click="onChangeDictationLocaleButtonClicked_"
|
||||
aria-describedby="dictationLocaleMenuLabel">
|
||||
$i18n{dictationChangeLanguageButton}
|
||||
</cr-button>
|
||||
<template is="dom-if" if="[[showDictationLocaleMenu_]]" restamp>
|
||||
<os-settings-change-dictation-locale-dialog
|
||||
id="changeDictationLocaleDialog"
|
||||
pref="{{prefs.settings.a11y.dictation_locale}}"
|
||||
on-close="onChangeDictationLocalesDialogClosed_"
|
||||
options="[[dictationLocaleOptions_]]">
|
||||
</os-settings-change-dictation-locale-dialog>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.focus_highlight}}"
|
||||
label="$i18n{focusHighlightLabel}"
|
||||
sub-label="$i18n{focusHighlightLabelSubtext}"
|
||||
deep-link-focus-id$="[[Setting.kHighlightKeyboardFocus]]">
|
||||
</settings-toggle-button>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.caret_highlight}}"
|
||||
label="$i18n{caretHighlightLabel}"
|
||||
sub-label="$i18n{caretHighlightLabelSubtext}"
|
||||
deep-link-focus-id$="[[Setting.kHighlightTextCaret]]">
|
||||
</settings-toggle-button>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.caretbrowsing.enabled}}"
|
||||
on-change="onA11yCaretBrowsingChange_"
|
||||
label="$i18n{caretBrowsingLabel}"
|
||||
sub-label="$i18n{caretBrowsingLabelSubtext}">
|
||||
</settings-toggle-button>
|
||||
<template is="dom-if" if="[[!isKioskModeActive_]]">
|
||||
<settings-toggle-button
|
||||
id="enableSwitchAccess"
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.switch_access.enabled}}"
|
||||
label="$i18n{switchAccessLabel}"
|
||||
sub-label="$i18n{switchAccessLabelSubtext}"
|
||||
deep-link-focus-id$="[[Setting.kEnableSwitchAccess]]">
|
||||
</settings-toggle-button>
|
||||
<iron-collapse
|
||||
opened="[[prefs.settings.a11y.switch_access.enabled.value]]">
|
||||
<div class="sub-item">
|
||||
<cr-link-row id="switchAccessSubpageButton"
|
||||
label="$i18n{switchAccessOptionsLabel}"
|
||||
on-click="onSwitchAccessSettingsClick_"
|
||||
role-description="$i18n{subpageArrowRoleDescription}" embedded>
|
||||
</cr-link-row>
|
||||
</div>
|
||||
</iron-collapse>
|
||||
<cr-link-row id="keyboardSubpageButton" class="hr"
|
||||
label="$i18n{keyboardSettingsTitle}" on-click="onKeyboardClick_"
|
||||
sub-label="$i18n{keyboardSettingsDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}" embedded>
|
||||
</cr-link-row>
|
||||
</template>
|
||||
|
||||
<h2>$i18n{mouseAndTouchpadHeading}</h2>
|
||||
<settings-toggle-button
|
||||
pref="{{prefs.settings.a11y.autoclick}}"
|
||||
label="$i18n{clickOnStopLabel}"
|
||||
sub-label="$i18n{clickOnStopDescription}"
|
||||
deep-link-focus-id$="[[Setting.kAutoClickWhenCursorStops]]">
|
||||
</settings-toggle-button>
|
||||
<div class="settings-box continuation"
|
||||
hidden$="[[!prefs.settings.a11y.autoclick.value]]">
|
||||
<div class="start sub-item settings-box-text" aria-hidden="true">
|
||||
$i18n{delayBeforeClickLabel}
|
||||
</div>
|
||||
<settings-dropdown-menu label="$i18n{delayBeforeClickLabel}"
|
||||
pref="{{prefs.settings.a11y.autoclick_delay_ms}}"
|
||||
menu-options="[[autoClickDelayOptions_]]"
|
||||
disabled="[[!prefs.settings.a11y.autoclick.value]]">
|
||||
</settings-dropdown-menu>
|
||||
</div>
|
||||
<div class="sub-item">
|
||||
<settings-toggle-button class="sub-item"
|
||||
hidden$="[[!prefs.settings.a11y.autoclick.value]]"
|
||||
pref="{{prefs.settings.a11y.autoclick_stabilize_position}}"
|
||||
label="$i18n{autoclickStabilizeCursorPosition}">
|
||||
</settings-toggle-button>
|
||||
</div>
|
||||
<div class="sub-item">
|
||||
<settings-toggle-button class="sub-item"
|
||||
hidden$="[[!prefs.settings.a11y.autoclick.value]]"
|
||||
pref="{{prefs.settings.a11y.autoclick_revert_to_left_click}}"
|
||||
label="$i18n{autoclickRevertToLeftClick}">
|
||||
</settings-toggle-button>
|
||||
</div>
|
||||
<div class="settings-box continuation"
|
||||
hidden$="[[!prefs.settings.a11y.autoclick.value]]">
|
||||
<div class="start sub-item settings-box-text" aria-hidden="true">
|
||||
$i18n{autoclickMovementThresholdLabel}
|
||||
</div>
|
||||
<settings-dropdown-menu
|
||||
label="$i18n{autoclickMovementThresholdLabel}"
|
||||
pref="{{prefs.settings.a11y.autoclick_movement_threshold}}"
|
||||
menu-options="[[autoClickMovementThresholdOptions_]]"
|
||||
disabled="[[!prefs.settings.a11y.autoclick.value]]">
|
||||
</settings-dropdown-menu>
|
||||
</div>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.large_cursor_enabled}}"
|
||||
label="$i18n{largeMouseCursorLabel}"
|
||||
deep-link-focus-id$="[[Setting.kLargeCursor]]">
|
||||
</settings-toggle-button>
|
||||
<div class="settings-box continuation"
|
||||
hidden$="[[!prefs.settings.a11y.large_cursor_enabled.value]]">
|
||||
<div class="start sub-item settings-box-text" aria-hidden="true">
|
||||
$i18n{largeMouseCursorSizeLabel}
|
||||
</div>
|
||||
<settings-slider
|
||||
pref="{{prefs.settings.a11y.large_cursor_dip_size}}"
|
||||
min="25" max="64"
|
||||
label-aria="$i18n{largeMouseCursorSizeLabel}"
|
||||
label-min="$i18n{largeMouseCursorSizeDefaultLabel}"
|
||||
label-max="$i18n{largeMouseCursorSizeLargeLabel}">
|
||||
</settings-slider>
|
||||
</div>
|
||||
<div class="settings-box">
|
||||
<div class="start settings-box-text" id="cursorColorOptionsLabel">
|
||||
$i18n{cursorColorOptionsLabel}
|
||||
</div>
|
||||
<settings-dropdown-menu aria-labeledby="cursorColorOptionsLabel"
|
||||
pref="{{prefs.settings.a11y.cursor_color}}"
|
||||
menu-options="[[cursorColorOptions_]]"
|
||||
on-settings-control-change="onA11yCursorColorChange_"
|
||||
deep-link-focus-id$="[[Setting.kEnableCursorColor]]">
|
||||
</settings-dropdown-menu>
|
||||
</div>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.cursor_highlight}}"
|
||||
label="$i18n{cursorHighlightLabel}"
|
||||
deep-link-focus-id$="[[Setting.kHighlightCursorWhileMoving]]">
|
||||
</settings-toggle-button>
|
||||
<cr-link-row id="pointerSubpageButton" class="hr"
|
||||
label="$i18n{mouseSettingsTitle}" on-click="onMouseClick_"
|
||||
role-description="$i18n{subpageArrowRoleDescription}" embedded>
|
||||
</cr-link-row>
|
||||
<template is="dom-if" if="[[showShelfNavigationButtonsSettings_]]" restamp>
|
||||
<!-- If shelf navigation buttons are implicitly enabled by other a11y
|
||||
settings (e.g. by spoken feedback), the toggle control should be
|
||||
disabled, and toggled regardless of the actual backing pref value. To
|
||||
handle effective pref value changes, wrap the backing pref in a
|
||||
private property, which changes to a stub pref object when the setting
|
||||
is implicitly enabled. -->
|
||||
<settings-toggle-button
|
||||
id="shelfNavigationButtonsEnabledControl"
|
||||
class="hr"
|
||||
disabled="[[shelfNavigationButtonsImplicitlyEnabled_]]"
|
||||
pref="[[shelfNavigationButtonsPref_]]"
|
||||
no-set-pref
|
||||
on-settings-boolean-control-change=
|
||||
"updateShelfNavigationButtonsEnabledPref_"
|
||||
label="$i18n{tabletModeShelfNavigationButtonsSettingLabel}"
|
||||
sub-label="$i18n{tabletModeShelfNavigationButtonsSettingDescription}"
|
||||
learn-more-url="$i18n{tabletModeShelfNavigationButtonsLearnMoreUrl}"
|
||||
on-learn-more-clicked="onShelfNavigationButtonsLearnMoreClicked_"
|
||||
deep-link-focus-id$="[[Setting.kTabletNavigationButtons]]">
|
||||
</settings-toggle-button>
|
||||
</template>
|
||||
|
||||
<h2>$i18n{audioAndCaptionsHeading}</h2>
|
||||
<settings-toggle-button
|
||||
class="hr"
|
||||
pref="{{prefs.settings.a11y.mono_audio}}"
|
||||
label="$i18n{monoAudioLabel}"
|
||||
sub-label="$i18n{monoAudioDescription}"
|
||||
deep-link-focus-id$="[[Setting.kMonoAudio]]">
|
||||
</settings-toggle-button>
|
||||
<div class="settings-box">
|
||||
<div class="start settings-box-text" id="startupSoundEnabledLabel">
|
||||
$i18n{startupSoundLabel}
|
||||
</div>
|
||||
<cr-toggle id="startupSoundEnabled"
|
||||
aria-labelledby="startupSoundEnabledLabel"
|
||||
deep-link-focus-id$="[[Setting.kStartupSound]]"
|
||||
on-change="toggleStartupSoundEnabled_">
|
||||
</cr-toggle>
|
||||
</div>
|
||||
|
||||
<template is="dom-if"
|
||||
if="[[shouldShowAdditionalFeaturesLink_(isKioskModeActive_, isGuest_)]]">
|
||||
<cr-link-row
|
||||
id="additionalFeaturesLink" class="hr"
|
||||
label="$i18n{additionalFeaturesTitle}"
|
||||
on-click="onAdditionalFeaturesClick_"
|
||||
external>
|
||||
</cr-link-row>
|
||||
</template>
|
@ -1,73 +0,0 @@
|
||||
// Copyright 2020 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
export interface ManageA11ySubpageBrowserProxy {
|
||||
/**
|
||||
* Opens the options page for Chrome Vox.
|
||||
*/
|
||||
showChromeVoxSettings(): void;
|
||||
|
||||
/**
|
||||
* Opens the options page for select to speak.
|
||||
*/
|
||||
showSelectToSpeakSettings(): void;
|
||||
|
||||
/**
|
||||
* Sets the startup sound to enabled.
|
||||
*/
|
||||
setStartupSoundEnabled(enabled: boolean): void;
|
||||
|
||||
/**
|
||||
* Records the value of the show shelf navigation button.
|
||||
*/
|
||||
recordSelectedShowShelfNavigationButtonValue(enabled: boolean): void;
|
||||
|
||||
/**
|
||||
* Requests whether startup sound and tablet mode are enabled. Result
|
||||
* is returned by the 'initial-data-ready' WebUI listener event.
|
||||
*/
|
||||
manageA11yPageReady(): void;
|
||||
|
||||
/**
|
||||
* Opens the ChromeVox tutorial.
|
||||
*/
|
||||
showChromeVoxTutorial(): void;
|
||||
}
|
||||
|
||||
let instance: ManageA11ySubpageBrowserProxy|null = null;
|
||||
|
||||
export class ManageA11ySubpageBrowserProxyImpl implements
|
||||
ManageA11ySubpageBrowserProxy {
|
||||
static getInstance(): ManageA11ySubpageBrowserProxy {
|
||||
return instance || (instance = new ManageA11ySubpageBrowserProxyImpl());
|
||||
}
|
||||
|
||||
static setInstanceForTesting(obj: ManageA11ySubpageBrowserProxy): void {
|
||||
instance = obj;
|
||||
}
|
||||
|
||||
showChromeVoxSettings(): void {
|
||||
chrome.send('showChromeVoxSettings');
|
||||
}
|
||||
|
||||
showSelectToSpeakSettings(): void {
|
||||
chrome.send('showSelectToSpeakSettings');
|
||||
}
|
||||
|
||||
setStartupSoundEnabled(enabled: boolean): void {
|
||||
chrome.send('setStartupSoundEnabled', [enabled]);
|
||||
}
|
||||
|
||||
recordSelectedShowShelfNavigationButtonValue(enabled: boolean): void {
|
||||
chrome.send('recordSelectedShowShelfNavigationButtonValue', [enabled]);
|
||||
}
|
||||
|
||||
manageA11yPageReady(): void {
|
||||
chrome.send('manageA11yPageReady');
|
||||
}
|
||||
|
||||
showChromeVoxTutorial(): void {
|
||||
chrome.send('showChromeVoxTutorial');
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
<div route-path="default">
|
||||
<settings-card header-text="$i18n{a11yPageTitle}">
|
||||
<settings-toggle-button
|
||||
id="a11yImageLabels"
|
||||
id="a11yImageLabelsToggle"
|
||||
hidden="[[!showAccessibilityLabelsSetting_]]"
|
||||
pref="{{prefs.settings.a11y.enable_accessibility_image_labels}}"
|
||||
on-change="onToggleAccessibilityImageLabels_"
|
||||
@ -15,13 +15,12 @@
|
||||
</settings-toggle-button>
|
||||
<div class="hr" hidden="[[!showAccessibilityLabelsSetting_]]"></div>
|
||||
<settings-toggle-button id="optionsInMenuToggle"
|
||||
hidden="[[isKioskModeActive_]]"
|
||||
label="$i18n{optionsInMenuLabel}"
|
||||
sub-label="$i18n{optionsInMenuDescription}"
|
||||
pref="{{prefs.settings.a11y.enable_menu}}"
|
||||
deep-link-focus-id$="[[Setting.kA11yQuickSettings]]">
|
||||
</settings-toggle-button>
|
||||
<div class="hr" hidden="[[isKioskModeActive_]]"></div>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="textToSpeechSubpageTrigger"
|
||||
label="$i18n{textToSpeechLinkTitle}"
|
||||
on-click="onTextToSpeechClick_"
|
||||
@ -29,35 +28,34 @@
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="display-and-magnification-page-trigger"
|
||||
<cr-link-row id="displayAndMagnificationPageTrigger"
|
||||
label="$i18n{displayAndMagnificationLinkTitle}"
|
||||
on-click="onDisplayAndMagnificationClick_"
|
||||
sub-label="$i18n{displayAndMagnificationLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="keyboard-and-text-input-page-trigger"
|
||||
<cr-link-row id="keyboardAndTextInputPageTrigger"
|
||||
label="$i18n{keyboardAndTextInputLinkTitle}"
|
||||
on-click="onKeyboardAndTextInputClick_"
|
||||
sub-label="$i18n{keyboardAndTextInputLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="cursor-and-touchpad-page-trigger"
|
||||
<cr-link-row id="cursorAndTouchpadPageTrigger"
|
||||
label="$i18n{cursorAndTouchpadLinkTitle}"
|
||||
on-click="onCursorAndTouchpadClick_"
|
||||
sub-label="$i18n{cursorAndTouchpadLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="audio-and-captions-page-trigger"
|
||||
<cr-link-row id="audioAndCaptionsPageTrigger"
|
||||
label="$i18n{audioAndCaptionsLinkTitle}"
|
||||
on-click="onAudioAndCaptionsClick_"
|
||||
sub-label="$i18n{audioAndCaptionsLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<template is="dom-if"
|
||||
if="[[shouldShowAdditionalFeaturesLink_(isKioskModeActive_, isGuest_)]]">
|
||||
<template is="dom-if" if="[[!isGuest_]]">
|
||||
<cr-link-row
|
||||
id="additionalFeaturesLink" class="hr"
|
||||
label="$i18n{additionalFeaturesTitle}"
|
||||
@ -70,9 +68,51 @@
|
||||
|
||||
<template is="dom-if" route-path="/manageAccessibility">
|
||||
<os-settings-subpage page-title="$i18n{manageAccessibilityFeatures}"
|
||||
hide-close-button="[[isKioskModeActive_]]">
|
||||
<settings-manage-a11y-subpage prefs="{{prefs}}">
|
||||
</settings-manage-a11y-subpage>
|
||||
hide-close-button>
|
||||
<settings-toggle-button
|
||||
id="a11yImageLabelsToggle"
|
||||
hidden="[[!showAccessibilityLabelsSetting_]]"
|
||||
pref="{{prefs.settings.a11y.enable_accessibility_image_labels}}"
|
||||
on-change="onToggleAccessibilityImageLabels_"
|
||||
label="$i18n{accessibleImageLabelsTitle}"
|
||||
sub-label="$i18n{accessibleImageLabelsSubtitle}"
|
||||
deep-link-focus-id$="[[Setting.kGetImageDescriptionsFromGoogle]]">
|
||||
</settings-toggle-button>
|
||||
<div class="hr" hidden="[[!showAccessibilityLabelsSetting_]]"></div>
|
||||
<cr-link-row id="textToSpeechSubpageTrigger"
|
||||
label="$i18n{textToSpeechLinkTitle}"
|
||||
on-click="onTextToSpeechClick_"
|
||||
sub-label="$i18n{textToSpeechLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="displayAndMagnificationPageTrigger"
|
||||
label="$i18n{displayAndMagnificationLinkTitle}"
|
||||
on-click="onDisplayAndMagnificationClick_"
|
||||
sub-label="$i18n{displayAndMagnificationLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="keyboardAndTextInputPageTrigger"
|
||||
label="$i18n{keyboardAndTextInputLinkTitle}"
|
||||
on-click="onKeyboardAndTextInputClick_"
|
||||
sub-label="$i18n{keyboardAndTextInputLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="cursorAndTouchpadPageTrigger"
|
||||
label="$i18n{cursorAndTouchpadLinkTitle}"
|
||||
on-click="onCursorAndTouchpadClick_"
|
||||
sub-label="$i18n{cursorAndTouchpadLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
<div class="hr"></div>
|
||||
<cr-link-row id="audioAndCaptionsPageTrigger"
|
||||
label="$i18n{audioAndCaptionsLinkTitle}"
|
||||
on-click="onAudioAndCaptionsClick_"
|
||||
sub-label="$i18n{audioAndCaptionsLinkDescription}"
|
||||
role-description="$i18n{subpageArrowRoleDescription}">
|
||||
</cr-link-row>
|
||||
</os-settings-subpage>
|
||||
</template>
|
||||
<template is="dom-if" route-path="/textToSpeech">
|
||||
|
@ -31,7 +31,7 @@ import {OsA11yPageBrowserProxy, OsA11yPageBrowserProxyImpl} from './os_a11y_page
|
||||
|
||||
export interface OsSettingsA11yPageElement {
|
||||
$: {
|
||||
a11yImageLabels: SettingsToggleButtonElement,
|
||||
a11yImageLabelsToggle: SettingsToggleButtonElement,
|
||||
};
|
||||
}
|
||||
|
||||
@ -146,9 +146,6 @@ export class OsSettingsA11yPageElement extends OsSettingsA11yPageElementBase {
|
||||
override ready() {
|
||||
super.ready();
|
||||
|
||||
if (routes.MANAGE_ACCESSIBILITY) {
|
||||
this.addFocusConfig(routes.MANAGE_ACCESSIBILITY, '#subpage-trigger');
|
||||
}
|
||||
if (routes.A11Y_TEXT_TO_SPEECH) {
|
||||
this.addFocusConfig(
|
||||
routes.A11Y_TEXT_TO_SPEECH, '#textToSpeechSubpageTrigger');
|
||||
@ -156,20 +153,20 @@ export class OsSettingsA11yPageElement extends OsSettingsA11yPageElementBase {
|
||||
if (routes.A11Y_DISPLAY_AND_MAGNIFICATION) {
|
||||
this.addFocusConfig(
|
||||
routes.A11Y_DISPLAY_AND_MAGNIFICATION,
|
||||
'#display-and-magnification-page-trigger');
|
||||
'#displayAndMagnificationPageTrigger');
|
||||
}
|
||||
if (routes.A11Y_KEYBOARD_AND_TEXT_INPUT) {
|
||||
this.addFocusConfig(
|
||||
routes.A11Y_KEYBOARD_AND_TEXT_INPUT,
|
||||
'#keyboard-and-text-input-page-trigger');
|
||||
'#keyboardAndTextInputPageTrigger');
|
||||
}
|
||||
if (routes.A11Y_CURSOR_AND_TOUCHPAD) {
|
||||
this.addFocusConfig(
|
||||
routes.A11Y_CURSOR_AND_TOUCHPAD, '#cursor-and-touchpad-page-trigger');
|
||||
routes.A11Y_CURSOR_AND_TOUCHPAD, '#cursorAndTouchpadPageTrigger');
|
||||
}
|
||||
if (routes.A11Y_AUDIO_AND_CAPTIONS) {
|
||||
this.addFocusConfig(
|
||||
routes.A11Y_AUDIO_AND_CAPTIONS, '#audio-and-captions-page-trigger');
|
||||
routes.A11Y_AUDIO_AND_CAPTIONS, '#audioAndCaptionsPageTrigger');
|
||||
}
|
||||
|
||||
this.addWebUiListener(
|
||||
@ -189,27 +186,18 @@ export class OsSettingsA11yPageElement extends OsSettingsA11yPageElementBase {
|
||||
}
|
||||
}
|
||||
|
||||
private shouldShowAdditionalFeaturesLink_(isKiosk: boolean, isGuest: boolean):
|
||||
boolean {
|
||||
return !isKiosk && !isGuest;
|
||||
}
|
||||
|
||||
private onScreenReaderStateChanged_(hasScreenReader: boolean): void {
|
||||
this.hasScreenReader_ = hasScreenReader;
|
||||
this.showAccessibilityLabelsSetting_ = this.hasScreenReader_;
|
||||
}
|
||||
|
||||
private onToggleAccessibilityImageLabels_(): void {
|
||||
const a11yImageLabelsOn = this.$.a11yImageLabels.checked;
|
||||
const a11yImageLabelsOn = this.$.a11yImageLabelsToggle.checked;
|
||||
if (a11yImageLabelsOn) {
|
||||
this.browserProxy_.confirmA11yImageLabels();
|
||||
}
|
||||
}
|
||||
|
||||
private onManageAccessibilityFeaturesClick_(): void {
|
||||
Router.getInstance().navigateTo(routes.MANAGE_ACCESSIBILITY);
|
||||
}
|
||||
|
||||
private onTextToSpeechClick_(): void {
|
||||
Router.getInstance().navigateTo(routes.A11Y_TEXT_TO_SPEECH);
|
||||
}
|
||||
|
@ -160,7 +160,6 @@ export {NearbyShareHighVisibilityPageElement} from './nearby_share_page/nearby_s
|
||||
export {getReceiveManager, observeReceiveManager, setReceiveManagerForTesting} from './nearby_share_page/nearby_share_receive_manager.js';
|
||||
export {dataUsageStringToEnum, NearbyShareDataUsage} from './nearby_share_page/types.js';
|
||||
export {ChromeVoxSubpageBrowserProxy, ChromeVoxSubpageBrowserProxyImpl} from './os_a11y_page/chromevox_subpage_browser_proxy.js';
|
||||
export {ManageA11ySubpageBrowserProxy, ManageA11ySubpageBrowserProxyImpl} from './os_a11y_page/manage_a11y_subpage_browser_proxy.js';
|
||||
export {OsSettingsA11yPageElement} from './os_a11y_page/os_a11y_page.js';
|
||||
export {OsA11yPageBrowserProxy, OsA11yPageBrowserProxyImpl} from './os_a11y_page/os_a11y_page_browser_proxy.js';
|
||||
export {SelectToSpeakSubpageBrowserProxy, SelectToSpeakSubpageBrowserProxyImpl} from './os_a11y_page/select_to_speak_subpage_browser_proxy.js';
|
||||
|
@ -461,9 +461,8 @@ export function createRoutes(): OsSettingsRoutes {
|
||||
r.A11Y_TEXT_TO_SPEECH, routesMojom.SELECT_TO_SPEAK_SUBPAGE_PATH,
|
||||
Subpage.kSelectToSpeak);
|
||||
r.MANAGE_TTS_SETTINGS = createSubpage(
|
||||
loadTimeData.getBoolean('isKioskModeActive') ? r.MANAGE_ACCESSIBILITY :
|
||||
r.A11Y_TEXT_TO_SPEECH,
|
||||
routesMojom.TEXT_TO_SPEECH_SUBPAGE_PATH, Subpage.kTextToSpeech);
|
||||
r.A11Y_TEXT_TO_SPEECH, routesMojom.TEXT_TO_SPEECH_SUBPAGE_PATH,
|
||||
Subpage.kTextToSpeech);
|
||||
r.MANAGE_SWITCH_ACCESS_SETTINGS = createSubpage(
|
||||
r.A11Y_KEYBOARD_AND_TEXT_INPUT,
|
||||
routesMojom.SWITCH_ACCESS_OPTIONS_SUBPAGE_PATH,
|
||||
|
@ -174,8 +174,8 @@ build_webui_tests("build") {
|
||||
"os_a11y_page/cursor_and_touchpad_page_test.ts",
|
||||
"os_a11y_page/display_and_magnification_subpage_test.ts",
|
||||
"os_a11y_page/keyboard_and_text_input_page_test.ts",
|
||||
"os_a11y_page/manage_a11y_subpage_test.ts",
|
||||
"os_a11y_page/os_a11y_page_test.ts",
|
||||
"os_a11y_page/os_a11y_page_kiosk_mode_test.ts",
|
||||
"os_a11y_page/select_to_speak_subpage_test.ts",
|
||||
"os_a11y_page/switch_access_action_assignment_dialog_test.ts",
|
||||
"os_a11y_page/test_chromevox_subpage_browser_proxy.ts",
|
||||
|
@ -1,242 +0,0 @@
|
||||
// Copyright 2019 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'chrome://os-settings/lazy_load.js';
|
||||
|
||||
import {SettingsManageA11ySubpageElement} from 'chrome://os-settings/lazy_load.js';
|
||||
import {DevicePageBrowserProxyImpl, Router, routes, SettingsToggleButtonElement} from 'chrome://os-settings/os_settings.js';
|
||||
import {assert} from 'chrome://resources/js/assert_ts.js';
|
||||
import {webUIListenerCallback} from 'chrome://resources/js/cr.js';
|
||||
import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
|
||||
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
|
||||
import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js';
|
||||
import {isVisible} from 'chrome://webui-test/test_util.js';
|
||||
|
||||
import {TestDevicePageBrowserProxy} from '../device_page/test_device_page_browser_proxy.js';
|
||||
|
||||
suite('<settings-manage-a11y-subpage>', () => {
|
||||
let page: SettingsManageA11ySubpageElement;
|
||||
let deviceBrowserProxy: TestDevicePageBrowserProxy;
|
||||
const defaultPrefs = {
|
||||
'settings': {
|
||||
'a11y': {
|
||||
'tablet_mode_shelf_nav_buttons_enabled': {
|
||||
key: 'settings.a11y.tablet_mode_shelf_nav_buttons_enabled',
|
||||
type: chrome.settingsPrivate.PrefType.BOOLEAN,
|
||||
value: false,
|
||||
},
|
||||
'dictation': {
|
||||
key: 'prefs.settings.a11y.dictation',
|
||||
type: chrome.settingsPrivate.PrefType.BOOLEAN,
|
||||
value: true,
|
||||
},
|
||||
'dictation_locale': {
|
||||
key: 'prefs.settings.a11y.dictation_locale',
|
||||
type: chrome.settingsPrivate.PrefType.STRING,
|
||||
value: 'en-US',
|
||||
},
|
||||
},
|
||||
'accessibility': {
|
||||
key: 'settings.accessibility',
|
||||
type: chrome.settingsPrivate.PrefType.BOOLEAN,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
function initPage() {
|
||||
page = document.createElement('settings-manage-a11y-subpage');
|
||||
page.prefs = defaultPrefs;
|
||||
document.body.appendChild(page);
|
||||
}
|
||||
|
||||
setup(function() {
|
||||
deviceBrowserProxy = new TestDevicePageBrowserProxy();
|
||||
deviceBrowserProxy.hasMouse = true;
|
||||
deviceBrowserProxy.hasTouchpad = true;
|
||||
deviceBrowserProxy.hasPointingStick = false;
|
||||
DevicePageBrowserProxyImpl.setInstanceForTesting(deviceBrowserProxy);
|
||||
|
||||
loadTimeData.overrideValues({isKioskModeActive: true});
|
||||
Router.getInstance().navigateTo(routes.MANAGE_ACCESSIBILITY);
|
||||
});
|
||||
|
||||
teardown(function() {
|
||||
page.remove();
|
||||
Router.getInstance().resetRouteForTesting();
|
||||
});
|
||||
|
||||
test(
|
||||
'Page loads without crashing when prefs are not yet initialized in kiosk mode',
|
||||
() => {
|
||||
loadTimeData.overrideValues({isKioskModeActive: true});
|
||||
page = document.createElement('settings-manage-a11y-subpage');
|
||||
document.body.appendChild(page);
|
||||
|
||||
// Intentionally set prefs after page is appended to DOM to simulate
|
||||
// asynchronicity of initializing prefs
|
||||
page.prefs = defaultPrefs;
|
||||
});
|
||||
|
||||
test('some parts are hidden in kiosk mode', function() {
|
||||
loadTimeData.overrideValues({
|
||||
isKioskModeActive: true,
|
||||
showTabletModeShelfNavigationButtonsSettings: true,
|
||||
});
|
||||
initPage();
|
||||
// Add mouse and touchpad to show some hidden settings.
|
||||
deviceBrowserProxy.hasMouse = true;
|
||||
deviceBrowserProxy.hasTouchpad = true;
|
||||
flush();
|
||||
|
||||
// Accessibility learn more link should be hidden.
|
||||
assertFalse(
|
||||
isVisible(page.shadowRoot!.querySelector('setings-localized-link')));
|
||||
|
||||
// Shelf navigation buttons are not shown in kiosk mode, even if
|
||||
// showTabletModeShelfNavigationButtonsSettings is true.
|
||||
assertFalse(isVisible(page.shadowRoot!.querySelector(
|
||||
'#shelfNavigationButtonsEnabledControl')));
|
||||
|
||||
const allowed_subpages = [
|
||||
'chromeVoxSubpageButton',
|
||||
'selectToSpeakSubpageButton',
|
||||
'ttsSubpageButton',
|
||||
];
|
||||
|
||||
const subpages = page.root!.querySelectorAll('cr-link-row');
|
||||
subpages.forEach(function(subpage) {
|
||||
if (isVisible(subpage)) {
|
||||
assertTrue(allowed_subpages.includes(subpage.id));
|
||||
}
|
||||
});
|
||||
|
||||
// Additional features link is not visible.
|
||||
assertFalse(
|
||||
isVisible(page.shadowRoot!.querySelector('#additionalFeaturesLink')));
|
||||
});
|
||||
|
||||
test('Dictation labels', async () => {
|
||||
// Ensure that the Dictation locale menu is shown by setting the dictation
|
||||
// pref to true (done in default prefs) and populating dictation locale
|
||||
// options with mock data.
|
||||
initPage();
|
||||
const locales = [{
|
||||
name: 'English (United States)',
|
||||
worksOffline: true,
|
||||
installed: true,
|
||||
recommended: true,
|
||||
value: 'en-US',
|
||||
}];
|
||||
webUIListenerCallback('dictation-locales-set', locales);
|
||||
flush();
|
||||
|
||||
// Dictation toggle.
|
||||
const dictationSetting =
|
||||
page.shadowRoot!.querySelector<SettingsToggleButtonElement>(
|
||||
'#enableDictation');
|
||||
assert(dictationSetting);
|
||||
assertTrue(dictationSetting.checked);
|
||||
assertEquals('Dictation', dictationSetting.label);
|
||||
assertEquals(
|
||||
'Type with your voice. Use Search + D, then start speaking.',
|
||||
dictationSetting.subLabel);
|
||||
|
||||
// Dictation locale menu.
|
||||
const dictationLocaleMenuLabel =
|
||||
page.shadowRoot!.querySelector<HTMLElement>(
|
||||
'#dictationLocaleMenuLabel');
|
||||
const dictationLocaleMenuSubtitle =
|
||||
page.shadowRoot!.querySelector<HTMLElement>(
|
||||
'#dictationLocaleMenuSubtitle');
|
||||
assert(dictationLocaleMenuLabel);
|
||||
assert(dictationLocaleMenuSubtitle);
|
||||
assertEquals('Language', dictationLocaleMenuLabel.innerText);
|
||||
assertEquals(
|
||||
'English (United States) is processed locally and works offline',
|
||||
dictationLocaleMenuSubtitle.innerText);
|
||||
|
||||
// Fake a request to change the dictation locale menu subtitle.
|
||||
webUIListenerCallback('dictation-locale-menu-subtitle-changed', 'Testing');
|
||||
flush();
|
||||
|
||||
// Only the dictation locale subtitle should have changed.
|
||||
assertEquals('Dictation', dictationSetting.label);
|
||||
assertEquals(
|
||||
'Type with your voice. Use Search + D, then start speaking.',
|
||||
dictationSetting.subLabel);
|
||||
assertEquals('Language', dictationLocaleMenuLabel.innerText);
|
||||
assertEquals('Testing', dictationLocaleMenuSubtitle.innerText);
|
||||
});
|
||||
|
||||
test('Test computeDictationLocaleSubtitle_()', async () => {
|
||||
initPage();
|
||||
const locales = [
|
||||
{
|
||||
name: 'English (United States)',
|
||||
worksOffline: true,
|
||||
installed: true,
|
||||
recommended: true,
|
||||
value: 'en-US',
|
||||
},
|
||||
{
|
||||
name: 'Spanish',
|
||||
worksOffline: true,
|
||||
installed: false,
|
||||
recommended: false,
|
||||
value: 'es',
|
||||
},
|
||||
{
|
||||
name: 'German',
|
||||
// Note: this data should never occur in practice. If a locale isn't
|
||||
// supported offline, then it should never be installed. Test this case
|
||||
// to verify our code still works given unexpected input.
|
||||
worksOffline: false,
|
||||
installed: true,
|
||||
recommended: false,
|
||||
value: 'de',
|
||||
},
|
||||
{
|
||||
name: 'French (France)',
|
||||
worksOffline: false,
|
||||
installed: false,
|
||||
recommended: false,
|
||||
value: 'fr-FR',
|
||||
},
|
||||
];
|
||||
webUIListenerCallback('dictation-locales-set', locales);
|
||||
page.set('dictationLocaleSubtitleOverride_', 'Testing');
|
||||
flush();
|
||||
assertEquals(
|
||||
'English (United States) is processed locally and works offline',
|
||||
page.get('dictationLocaleMenuSubtitle_'));
|
||||
|
||||
// Changing the Dictation locale pref should change the subtitle
|
||||
// computation.
|
||||
page.set('prefs.settings.a11y.dictation_locale.value', 'es');
|
||||
assertEquals(
|
||||
'Couldn’t download Spanish speech files. Download will be attempted ' +
|
||||
'later. Speech is sent to Google for processing until download ' +
|
||||
'is completed.',
|
||||
page.get('dictationLocaleMenuSubtitle_'));
|
||||
|
||||
page.set('prefs.settings.a11y.dictation_locale.value', 'de');
|
||||
assertEquals(
|
||||
'German speech is sent to Google for processing',
|
||||
page.get('dictationLocaleMenuSubtitle_'));
|
||||
|
||||
page.set('prefs.settings.a11y.dictation_locale.value', 'fr-FR');
|
||||
assertEquals(
|
||||
'French (France) speech is sent to Google for processing',
|
||||
page.get('dictationLocaleMenuSubtitle_'));
|
||||
|
||||
// Only use the subtitle override once.
|
||||
page.set('useDictationLocaleSubtitleOverride_', true);
|
||||
assertEquals('Testing', page['computeDictationLocaleSubtitle_']());
|
||||
assertFalse(page.get('useDictationLocaleSubtitleOverride_'));
|
||||
assertEquals(
|
||||
'French (France) speech is sent to Google for processing',
|
||||
page['computeDictationLocaleSubtitle_']());
|
||||
});
|
||||
});
|
83
chrome/test/data/webui/settings/chromeos/os_a11y_page/os_a11y_page_kiosk_mode_test.ts
Normal file
83
chrome/test/data/webui/settings/chromeos/os_a11y_page/os_a11y_page_kiosk_mode_test.ts
Normal file
@ -0,0 +1,83 @@
|
||||
// Copyright 2019 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'chrome://os-settings/lazy_load.js';
|
||||
|
||||
import {OsSettingsA11yPageElement, Router, routes} from 'chrome://os-settings/os_settings.js';
|
||||
import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
|
||||
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
|
||||
import {assertFalse} from 'chrome://webui-test/chai_assert.js';
|
||||
import {isVisible} from 'chrome://webui-test/test_util.js';
|
||||
|
||||
suite('OsSettingsA11yPageKioskModeTest', () => {
|
||||
let page: OsSettingsA11yPageElement;
|
||||
const defaultPrefs = {
|
||||
'settings': {
|
||||
'a11y': {
|
||||
'tablet_mode_shelf_nav_buttons_enabled': {
|
||||
key: 'settings.a11y.tablet_mode_shelf_nav_buttons_enabled',
|
||||
type: chrome.settingsPrivate.PrefType.BOOLEAN,
|
||||
value: false,
|
||||
},
|
||||
'dictation': {
|
||||
key: 'prefs.settings.a11y.dictation',
|
||||
type: chrome.settingsPrivate.PrefType.BOOLEAN,
|
||||
value: true,
|
||||
},
|
||||
'dictation_locale': {
|
||||
key: 'prefs.settings.a11y.dictation_locale',
|
||||
type: chrome.settingsPrivate.PrefType.STRING,
|
||||
value: 'en-US',
|
||||
},
|
||||
},
|
||||
'accessibility': {
|
||||
key: 'settings.accessibility',
|
||||
type: chrome.settingsPrivate.PrefType.BOOLEAN,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
function initPage() {
|
||||
page = document.createElement('os-settings-a11y-page');
|
||||
page.prefs = defaultPrefs;
|
||||
document.body.appendChild(page);
|
||||
}
|
||||
|
||||
setup(() => {
|
||||
loadTimeData.overrideValues({isKioskModeActive: true});
|
||||
Router.getInstance().navigateTo(routes.MANAGE_ACCESSIBILITY);
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
page.remove();
|
||||
Router.getInstance().resetRouteForTesting();
|
||||
});
|
||||
|
||||
test(
|
||||
'Page loads without crashing when prefs are not yet initialized in kiosk mode',
|
||||
() => {
|
||||
loadTimeData.overrideValues({isKioskModeActive: true});
|
||||
page = document.createElement('os-settings-a11y-page');
|
||||
document.body.appendChild(page);
|
||||
|
||||
// Intentionally set prefs after page is appended to DOM to simulate
|
||||
// asynchronicity of initializing prefs
|
||||
page.prefs = defaultPrefs;
|
||||
});
|
||||
|
||||
test('some parts are hidden in kiosk mode', () => {
|
||||
loadTimeData.overrideValues({isKioskModeActive: true});
|
||||
initPage();
|
||||
flush();
|
||||
|
||||
// Show accessibility options in Quick Settings toggle is not visible.
|
||||
assertFalse(
|
||||
isVisible(page.shadowRoot!.querySelector('#optionsInMenuToggle')));
|
||||
|
||||
// Additional features link is not visible.
|
||||
assertFalse(
|
||||
isVisible(page.shadowRoot!.querySelector('#additionalFeaturesLink')));
|
||||
});
|
||||
});
|
@ -5,7 +5,7 @@
|
||||
import 'chrome://os-settings/os_settings.js';
|
||||
import 'chrome://os-settings/lazy_load.js';
|
||||
|
||||
import {CrSettingsPrefs, OsA11yPageBrowserProxyImpl, OsSettingsA11yPageElement, Router, routes, SettingsPrefsElement} from 'chrome://os-settings/os_settings.js';
|
||||
import {CrSettingsPrefs, OsA11yPageBrowserProxyImpl, OsSettingsA11yPageElement, OsSettingsRoutes, Router, routes, SettingsPrefsElement} from 'chrome://os-settings/os_settings.js';
|
||||
import {assert} from 'chrome://resources/js/assert_ts.js';
|
||||
import {webUIListenerCallback} from 'chrome://resources/js/cr.js';
|
||||
import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
|
||||
@ -13,9 +13,15 @@ import {getDeepActiveElement} from 'chrome://resources/js/util_ts.js';
|
||||
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
|
||||
import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js';
|
||||
import {waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js';
|
||||
import {eventToPromise} from 'chrome://webui-test/test_util.js';
|
||||
|
||||
import {TestOsA11yPageBrowserProxy} from './test_os_a11y_page_browser_proxy.js';
|
||||
|
||||
interface SubpageTriggerData {
|
||||
triggerSelector: string;
|
||||
routeName: keyof OsSettingsRoutes;
|
||||
}
|
||||
|
||||
suite('<os-settings-a11y-page>', () => {
|
||||
let page: OsSettingsA11yPageElement;
|
||||
let prefElement: SettingsPrefsElement;
|
||||
@ -64,7 +70,7 @@ suite('<os-settings-a11y-page>', () => {
|
||||
|
||||
// Turn on 'Get image descriptions from Google'.
|
||||
const a11yImageLabelsToggle =
|
||||
page.shadowRoot!.querySelector<HTMLElement>('#a11yImageLabels');
|
||||
page.shadowRoot!.querySelector<HTMLElement>('#a11yImageLabelsToggle');
|
||||
a11yImageLabelsToggle!.click();
|
||||
flush();
|
||||
|
||||
@ -98,4 +104,52 @@ suite('<os-settings-a11y-page>', () => {
|
||||
await waitAfterNextRender(pdfOcrToggle);
|
||||
assertFalse(pdfOcrToggle.hidden);
|
||||
});
|
||||
|
||||
const subpageTriggerData: SubpageTriggerData[] = [
|
||||
{
|
||||
triggerSelector: '#textToSpeechSubpageTrigger',
|
||||
routeName: 'A11Y_TEXT_TO_SPEECH',
|
||||
},
|
||||
{
|
||||
triggerSelector: '#displayAndMagnificationPageTrigger',
|
||||
routeName: 'A11Y_DISPLAY_AND_MAGNIFICATION',
|
||||
},
|
||||
{
|
||||
triggerSelector: '#keyboardAndTextInputPageTrigger',
|
||||
routeName: 'A11Y_KEYBOARD_AND_TEXT_INPUT',
|
||||
},
|
||||
{
|
||||
triggerSelector: '#cursorAndTouchpadPageTrigger',
|
||||
routeName: 'A11Y_CURSOR_AND_TOUCHPAD',
|
||||
},
|
||||
{
|
||||
triggerSelector: '#audioAndCaptionsPageTrigger',
|
||||
routeName: 'A11Y_AUDIO_AND_CAPTIONS',
|
||||
},
|
||||
];
|
||||
subpageTriggerData.forEach(({triggerSelector, routeName}) => {
|
||||
test(
|
||||
`Row for ${routeName} is focused when returning from subpage`,
|
||||
async () => {
|
||||
Router.getInstance().navigateTo(routes.OS_ACCESSIBILITY);
|
||||
|
||||
const subpageTrigger =
|
||||
page.shadowRoot!.querySelector<HTMLElement>(triggerSelector);
|
||||
assertTrue(!!subpageTrigger);
|
||||
|
||||
// Sub-page trigger navigates to subpage for route
|
||||
subpageTrigger.click();
|
||||
assertEquals(routes[routeName], Router.getInstance().currentRoute);
|
||||
|
||||
// Navigate back
|
||||
const popStateEventPromise = eventToPromise('popstate', window);
|
||||
Router.getInstance().navigateToPreviousRoute();
|
||||
await popStateEventPromise;
|
||||
await waitAfterNextRender(page);
|
||||
|
||||
assertEquals(
|
||||
subpageTrigger, page.shadowRoot!.activeElement,
|
||||
`${triggerSelector} should be focused.`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -489,8 +489,8 @@ TEST_F('OSSettingsCrostiniExtraContainerPageTest', 'AllJsTests', () => {
|
||||
'os_a11y_page/keyboard_and_text_input_page_test.js',
|
||||
],
|
||||
[
|
||||
'OsA11yPageManageA11ySubpage',
|
||||
'os_a11y_page/manage_a11y_subpage_test.js',
|
||||
'OsA11yPageKioskMode',
|
||||
'os_a11y_page/os_a11y_page_kiosk_mode_test.js',
|
||||
],
|
||||
[
|
||||
'OsA11yPageSelectToSpeakSubpage',
|
||||
|
@ -49,8 +49,7 @@ ash/system/accessibility/autoclick*
|
||||
chrome/browser/resources/chromeos/accessibility/accessibility_common/
|
||||
|
||||
In addition, there are settings for automatic clicks in
|
||||
chrome/browser/resources/settings/a11y_page/manage_a11y_subpage.*
|
||||
|
||||
chrome/browser/resources/ash/settings/os_a11y_page/cursor_and_touchpad_page.*
|
||||
|
||||
### Tests
|
||||
|
||||
|
@ -52,7 +52,7 @@ chrome/browser/resources/chromeos/accessibility/select_to_speak/
|
||||
- Floating panel, system/accessibility/select_to_speak_menu_bubble_controller.h
|
||||
|
||||
In addition, there are settings for STS in
|
||||
chrome/browser/resources/settings/a11y_page/manage_a11y_subpage.*
|
||||
chrome/browser/resources/ash/settings/os_a11y_page/select_to_speak_subpage.*
|
||||
|
||||
### Tests
|
||||
|
||||
|
Reference in New Issue
Block a user