Commit ae415f74 authored by evliu's avatar evliu Committed by Commit Bot

Update the a11y_page

This CL contains the following changes to the a11y_page:
* Updating the Captions button icon to use the external icon for MacOS and Windows.
* Rearrange code so that there is only one default route path and place everything
  except for templates with their own route path in the default route.
* Move the Captions button inside the settings-animated-pages. This fixes a focus
  glimpse when tapping on the Captions button using a touch screen device.
* Move the Captions subpage template below all of the buttons.

Bug: 971264
Change-Id: I354373f5715153fb3a89745dc88e12dedde80020
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1799304Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Evan Liu <evliu@google.com>
Cr-Commit-Position: refs/heads/master@{#697308}
parent 11ce29f9
...@@ -19,43 +19,24 @@ ...@@ -19,43 +19,24 @@
<dom-module id="settings-a11y-page"> <dom-module id="settings-a11y-page">
<template> <template>
<style include="settings-shared"></style> <style include="settings-shared"></style>
<template is="dom-if" if="[[showCaptionSettings_]]">
<cr-link-row class="hr" id="captions" label="$i18n{captionsTitle}"
on-click="onCaptionsClick_">
</cr-link-row>
</template>
<settings-animated-pages id="pages" current-route="{{currentRoute}}" <settings-animated-pages id="pages" current-route="{{currentRoute}}"
section="a11y" focus-config="[[focusConfig_]]"> section="a11y" focus-config="[[focusConfig_]]">
<if expr="not chromeos">
<div route-path="default"> <div route-path="default">
<settings-toggle-button <cr-link-row class="hr" id="captions" label="$i18n{captionsTitle}"
id="a11yImageLabels" on-click="onCaptionsClick_" external$="[[captionSettingsOpensExternally_]]">
hidden$="[[!showAccessibilityLabelsSetting_]]" </cr-link-row>
pref="{{prefs.settings.a11y.enable_accessibility_image_labels}}" <if expr="not chromeos">
on-change="onToggleAccessibilityImageLabels_" <settings-toggle-button
label="$i18n{accessibleImageLabelsTitle}" id="a11yImageLabels"
sub-label="$i18n{accessibleImageLabelsSubtitle}"> hidden$="[[!showAccessibilityLabelsSetting_]]"
</settings-toggle-button> pref="{{prefs.settings.a11y.enable_accessibility_image_labels}}"
<cr-link-row class="hr" label="$i18n{moreFeaturesLink}" on-change="onToggleAccessibilityImageLabels_"
on-click="onMoreFeaturesLinkClick_" sub-label="$i18n{a11yWebStore}" label="$i18n{accessibleImageLabelsTitle}"
external> sub-label="$i18n{accessibleImageLabelsSubtitle}">
</cr-link-row> </settings-toggle-button>
</div>
</if>
<if expr="chromeos or is_linux or is_win">
<template is="dom-if" if="[[showCaptionSettings_]]">
<template is="dom-if" route-path="/captions">
<settings-subpage
associated-control="[[$$('#captions')]]"
page-title="$i18n{captionsTitle}">
<settings-captions prefs="{{prefs}}"></settings-captions>
</settings-subpage>
</template>
</template>
</if> </if>
<if expr="chromeos"> <if expr="chromeos">
<template is="dom-if" if="[[pageVisibility.webstoreLink]]"> <template is="dom-if" if="[[pageVisibility.webstoreLink]]">
<div route-path="default">
<settings-toggle-button <settings-toggle-button
id="a11yImageLabels" id="a11yImageLabels"
hidden$="[[!showAccessibilityLabelsSetting_]]" hidden$="[[!showAccessibilityLabelsSetting_]]"
...@@ -73,7 +54,26 @@ ...@@ -73,7 +54,26 @@
on-click="onManageAccessibilityFeaturesTap_" on-click="onManageAccessibilityFeaturesTap_"
sub-label="$i18n{moreFeaturesLinkDescription}"> sub-label="$i18n{moreFeaturesLinkDescription}">
</cr-link-row> </cr-link-row>
</div> </template>
</if>
<cr-link-row class="hr" label="$i18n{moreFeaturesLink}"
on-click="onMoreFeaturesLinkClick_" sub-label="$i18n{a11yWebStore}"
hidden="[[pageVisibility.webstoreLink]]" external>
</cr-link-row>
</div>
<if expr="not is_macosx">
<template is="dom-if" if="[[showCaptionSettings_]]">
<template is="dom-if" route-path="/captions">
<settings-subpage
associated-control="[[$$('#captions')]]"
page-title="$i18n{captionsTitle}">
<settings-captions prefs="{{prefs}}"></settings-captions>
</settings-subpage>
</template>
</template>
</if>
<if expr="chromeos">
<template is="dom-if" if="[[pageVisibility.webstoreLink]]">
<template is="dom-if" route-path="/manageAccessibility"> <template is="dom-if" route-path="/manageAccessibility">
<settings-subpage <settings-subpage
associated-control="[[$$('#subpage-trigger')]]" associated-control="[[$$('#subpage-trigger')]]"
...@@ -86,8 +86,7 @@ ...@@ -86,8 +86,7 @@
<settings-subpage <settings-subpage
associated-control="[[$$('#subpage-trigger')]]" associated-control="[[$$('#subpage-trigger')]]"
page-title="$i18n{manageTtsSettings}"> page-title="$i18n{manageTtsSettings}">
<settings-tts-subpage prefs="{{prefs}}"> <settings-tts-subpage prefs="{{prefs}}"></settings-tts-subpage>
</settings-tts-subpage>
</settings-subpage> </settings-subpage>
</template> </template>
<template is="dom-if" route-path="/manageAccessibility/switchAccess"> <template is="dom-if" route-path="/manageAccessibility/switchAccess">
...@@ -100,12 +99,6 @@ ...@@ -100,12 +99,6 @@
</template> </template>
</if> </if>
</settings-animated-pages> </settings-animated-pages>
<if expr="chromeos">
<cr-link-row class="hr" label="$i18n{moreFeaturesLink}"
on-click="onMoreFeaturesLinkClick_" sub-label="$i18n{a11yWebStore}"
hidden="[[pageVisibility.webstoreLink]]" external>
</cr-link-row>
</if>
</template> </template>
<script src="a11y_page.js"></script> <script src="a11y_page.js"></script>
</dom-module> </dom-module>
...@@ -67,6 +67,26 @@ Polymer({ ...@@ -67,6 +67,26 @@ Polymer({
}, },
}, },
/**
* Whether the caption settings link opens externally.
* @private {boolean}
*/
captionSettingsOpensExternally_: {
type: Boolean,
value: function() {
let opensExternally = false;
// <if expr="is_macosx">
opensExternally = true;
// </if>
// <if expr="is_win">
opensExternally = loadTimeData.getBoolean('isWindows10OrNewer');
// </if>
return opensExternally;
},
},
// <if expr="chromeos"> // <if expr="chromeos">
/** /**
* Whether to show experimental accessibility features. * Whether to show experimental accessibility features.
......
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