Commit d1e7dab0 authored by Monica Basta's avatar Monica Basta Committed by Commit Bot

[SyncSetup]: Add label for two external link buttons for a11y

This CL adds aria-label for the two external link buttons in the sync
section in chrome://settings/syncSetup page.

Bug: 1066599
Change-Id: I95ff9149b9e1e3da0dbea25b067a26aa7af6fd0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132452Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Monica Basta <msalama@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756006}
parent 3df3f3b8
...@@ -187,7 +187,8 @@ ...@@ -187,7 +187,8 @@
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}"> learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
<settings-sync-page <settings-sync-page
sync-status="[[syncStatus]]" prefs="{{prefs}}" sync-status="[[syncStatus]]" prefs="{{prefs}}"
page-visibility="[[pageVisibility.privacy]]"> page-visibility="[[pageVisibility.privacy]]"
focus-config="[[focusConfig_]]">
</settings-sync-page> </settings-sync-page>
</settings-subpage> </settings-subpage>
</template> </template>
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
<link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/util.html"> <link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/cr_link_row/cr_link_row.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> <link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html"> <link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
...@@ -93,6 +94,11 @@ ...@@ -93,6 +94,11 @@
left: auto; left: auto;
right: 0; right: 0;
} }
cr-link-row {
padding-inline-start: 0;
padding-inline-end: 8px;
}
</style> </style>
<template is="dom-if" if="[[shouldShowSyncAccountControl_( <template is="dom-if" if="[[shouldShowSyncAccountControl_(
syncStatus.syncSystemEnabled)]]"> syncStatus.syncSystemEnabled)]]">
...@@ -157,34 +163,18 @@ ...@@ -157,34 +163,18 @@
<div id="[[pages_.CONFIGURE]]" <div id="[[pages_.CONFIGURE]]"
hidden$="[[!isStatus_(pages_.CONFIGURE, pageStatus_)]]"> hidden$="[[!isStatus_(pages_.CONFIGURE, pageStatus_)]]">
<div id="other-sync-items" class="list-frame"> <div id="other-sync-items" class="list-frame">
<div id="sync-advanced-row" class="list-item first" <cr-link-row id="sync-advanced-row"
on-click="onSyncAdvancedTap_" actionable> label="$i18n{syncAdvancedPageTitle}"
<div class="start" id="page-title" aria-hidden="true"> on-click="onSyncAdvancedClick_"></cr-link-row>
$i18n{syncAdvancedPageTitle}
</div>
<cr-icon-button class="subpage-arrow" aria-labelledby="page-title"
aria-roledescription="$i18n{subpageArrowRoleDescription}">
</cr-icon-button>
</div>
<a class="inherit-color no-outline list-item" tabindex="-1" <cr-link-row class="hr"
target="_blank" href="$i18n{activityControlsUrl}" label="$i18n{personalizeGoogleServicesTitle}"
on-click="onActivityControlsTap_"> on-click="onActivityControlsClick_" external></cr-link-row>
<div class="start settings-box-text">
$i18n{personalizeGoogleServicesTitle}
</div>
<cr-icon-button class="icon-external"></cr-icon-button>
</a>
<a id="syncDashboardLink" <cr-link-row id="syncDashboardLink" class="hr"
class="inherit-color no-outline list-item" label="$i18n{manageSyncedDataTitle}"
tabindex="-1" target="_blank" href="$i18n{syncDashboardUrl}" on-click="onSyncDashboardLinkClick_"
hidden="[[syncStatus.supervisedUser]]"> hidden="[[syncStatus.supervisedUser]]" external></cr-link-row>
<div class="start settings-box-text">
$i18n{manageSyncedDataTitle}
</div>
<cr-icon-button class="icon-external"></cr-icon-button>
</a>
<template is="dom-if" if="[[!syncSetupFriendlySettings_]]"> <template is="dom-if" if="[[!syncSetupFriendlySettings_]]">
<div id="encryptionDescription" <div id="encryptionDescription"
......
...@@ -25,6 +25,12 @@ Polymer({ ...@@ -25,6 +25,12 @@ Polymer({
notify: true, notify: true,
}, },
/** @private {!Map<string, (string|Function)>} */
focusConfig: {
type: Object,
observer: 'onFocusConfigChange_',
},
/** @private */ /** @private */
pages_: { pages_: {
type: Object, type: Object,
...@@ -231,6 +237,14 @@ Polymer({ ...@@ -231,6 +237,14 @@ Polymer({
return this.syncStatus != undefined && !!this.syncStatus.managed; return this.syncStatus != undefined && !!this.syncStatus.managed;
}, },
/** @private */
onFocusConfigChange_() {
const router = settings.Router.getInstance();
this.focusConfig.set(router.getRoutes().SYNC_ADVANCED, () => {
cr.ui.focusWithoutInk(assert(this.$$('#sync-advanced-row')));
});
},
/** @private */ /** @private */
onSetupCancelDialogBack_() { onSetupCancelDialogBack_() {
/** @type {!CrDialogElement} */ (this.$$('#setupCancelDialog')).cancel(); /** @type {!CrDialogElement} */ (this.$$('#setupCancelDialog')).cancel();
...@@ -381,9 +395,15 @@ Polymer({ ...@@ -381,9 +395,15 @@ Polymer({
}, },
/** @private */ /** @private */
onActivityControlsTap_() { onActivityControlsClick_() {
chrome.metricsPrivate.recordUserAction('Sync_OpenActivityControlsPage'); chrome.metricsPrivate.recordUserAction('Sync_OpenActivityControlsPage');
this.browserProxy_.openActivityControlsUrl(); this.browserProxy_.openActivityControlsUrl();
window.open(loadTimeData.getString('activityControlsUrl'));
},
/** @private */
onSyncDashboardLinkClick_() {
window.open(loadTimeData.getString('syncDashboardUrl'));
}, },
/** /**
...@@ -512,7 +532,7 @@ Polymer({ ...@@ -512,7 +532,7 @@ Polymer({
}, },
/** @private */ /** @private */
onSyncAdvancedTap_() { onSyncAdvancedClick_() {
const router = settings.Router.getInstance(); const router = settings.Router.getInstance();
router.navigateTo(router.getRoutes().SYNC_ADVANCED); router.navigateTo(router.getRoutes().SYNC_ADVANCED);
}, },
......
...@@ -141,7 +141,9 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -141,7 +141,9 @@ cr.define('settings_people_page_sync_page', function() {
assertTrue(syncPage.$$('#sync-separator').hidden); assertTrue(syncPage.$$('#sync-separator').hidden);
assertTrue(otherItems.classList.contains('list-frame')); assertTrue(otherItems.classList.contains('list-frame'));
assertEquals( assertEquals(
otherItems.querySelectorAll(':scope > .list-item').length, 4); otherItems.querySelectorAll(':scope > .list-item').length, 1);
assertEquals(
otherItems.querySelectorAll(':scope > cr-link-row').length, 3);
// Test sync paused state. // Test sync paused state.
syncPage.syncStatus = { syncPage.syncStatus = {
......
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