Commit 9477fcd7 authored by yoshiki's avatar yoshiki Committed by Commit bot

[Files.app a11y] Add missing a11y labels into buttons

BUG=459695
TEST=manually tested

Review URL: https://codereview.chromium.org/939073002

Cr-Commit-Position: refs/heads/master@{#317049}
parent 54214cdf
......@@ -445,9 +445,18 @@ Press any key to continue exploring.
<message name="IDS_FILE_BROWSER_SHARE_BUTTON_LABEL" desc="Menu item label, showing dialog to share the selected file.">
Share
</message>
<message name="IDS_FILE_BROWSER_TASKS_BUTTON_LABEL" desc="Label for button that selects a task to open the current file.">
Tasks
</message>
<message name="IDS_FILE_BROWSER_CANCEL_SELECTION_BUTTON_LABEL" desc="Label for button that unselects all selected items.">
Cancel selection
</message>
<message name="IDS_FILE_BROWSER_CHANGE_TO_LISTVIEW_BUTTON_LABEL" desc="Label for button that changes the view mode to 'list view' mode.">
List view
</message>
<message name="IDS_FILE_BROWSER_CHANGE_TO_THUMBNAILVIEW_BUTTON_LABEL" desc="Label for button that changes the view mode to 'thumbnail view' mode.">
Thumbnail view
</message>
<message name="IDS_FILE_BROWSER_CLOUD_IMPORT_TITLE" desc="Title of the cloud import feature.">
Cloud backup
</message>
......
......@@ -486,7 +486,12 @@ bool FileManagerPrivateGetStringsFunction::RunSync() {
SET_STRING("SEARCH_NO_MATCHING_FILES_HTML",
IDS_FILE_BROWSER_SEARCH_NO_MATCHING_FILES_HTML);
SET_STRING("SEARCH_TEXT_LABEL", IDS_FILE_BROWSER_SEARCH_TEXT_LABEL);
SET_STRING("TASKS_BUTTON_LABEL", IDS_FILE_BROWSER_TASKS_BUTTON_LABEL);
SET_STRING("SHARE_BUTTON_LABEL", IDS_FILE_BROWSER_SHARE_BUTTON_LABEL);
SET_STRING("CHANGE_TO_LISTVIEW_BUTTON_LABEL",
IDS_FILE_BROWSER_CHANGE_TO_LISTVIEW_BUTTON_LABEL);
SET_STRING("CHANGE_TO_THUMBNAILVIEW_BUTTON_LABEL",
IDS_FILE_BROWSER_CHANGE_TO_THUMBNAILVIEW_BUTTON_LABEL);
SET_STRING("CANCEL_SELECTION_BUTTON_LABEL",
IDS_FILE_BROWSER_CANCEL_SELECTION_BUTTON_LABEL);
SET_STRING("SHARE_ERROR", IDS_FILE_BROWSER_SHARE_ERROR);
......
......@@ -535,6 +535,7 @@ VolumeItem.prototype.setupEjectButton_ = function(rowElement) {
ejectButton.addEventListener(
'mousedown', function(event) { event.stopPropagation() });
ejectButton.className = 'root-eject';
ejectButton.setAttribute('aria-label', str('UNMOUNT_DEVICE_BUTTON_LABEL'));
ejectButton.addEventListener('click', function(event) {
event.stopPropagation();
var unmountCommand = cr.doc.querySelector('command#unmount');
......
......@@ -369,8 +369,12 @@ FileManagerUI.prototype.relayout = function() {
FileManagerUI.prototype.setCurrentListType = function(listType) {
this.listContainer.setCurrentListType(listType);
this.toggleViewButton.classList.toggle(
'thumbnail', listType === ListContainer.ListType.DETAIL);
var isListView = (listType === ListContainer.ListType.DETAIL);
this.toggleViewButton.classList.toggle('thumbnail', isListView);
var label = isListView ? str('CHANGE_TO_THUMBNAILVIEW_BUTTON_LABEL') :
str('CHANGE_TO_LISTVIEW_BUTTON_LABEL');
this.toggleViewButton.setAttribute('aria-label', label);
this.relayout();
};
......
......@@ -319,7 +319,8 @@
<div class="dialog-header">
<div id="location-breadcrumbs" class="breadcrumbs"></div>
<div id="cancel-selection-button-wrapper">
<paper-button id="cancel-selection-button" tabindex="-1">
<paper-button id="cancel-selection-button" tabindex="-1"
i18n-values="aria-label:CANCEL_SELECTION_BUTTON_LABEL">
<span class="icon-arrow-back"></span>
<span i18n-content="CANCEL_SELECTION_BUTTON_LABEL"></span>
</paper-button>
......@@ -327,15 +328,18 @@
<div id="files-selected-label"></div>
<div class="spacer"></div>
<button id="tasks" class="combobutton" menu="#tasks-menu"
tabindex="7">
tabindex="7"
i18n-values="aria-label:TASKS_BUTTON_LABEL">
<paper-ripple fit></paper-ripple>
</button>
<button id="search-button" class="icon-button" tabindex="8">
<button id="search-button" class="icon-button" tabindex="8"
i18n-values="aria-label:SEARCH_TEXT_LABEL">
<paper-ripple fit class="recenteringTouch circle"></paper-ripple>
</button>
<div id="search-box">
<paper-input-decorator i18n-values="label:SEARCH_TEXT_LABEL">
<input is="core-input" type="search" tabindex="-1" i18n-values="aria-label:SEARCH_TEXT_LABEL">
<input is="core-input" type="search" tabindex="-1"
i18n-values="aria-label:SEARCH_TEXT_LABEL">
</paper-input-decorator>
<button class="clear" tabindex="-1"></button>
</div>
......@@ -365,7 +369,8 @@
<core-icon icon="arrow-drop-down"></core-icon>
<paper-ripple fit class="recenteringTouch circle"></paper-ripple>
</button>
<button id="view-button" class="icon-button" tabindex="13">
<button id="view-button" class="icon-button" tabindex="13"
i18n-values="aria-label:CHANGE_TO_THUMBNAILVIEW_BUTTON_LABEL">
<paper-ripple fit class="recenteringTouch circle"></paper-ripple>
</button>
<button id="gear-button" class="icon-button" tabindex="14" menu="#gear-menu"
......
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