Commit 2533c251 authored by Tim Sergeant's avatar Tim Sergeant Committed by Commit Bot

MD Bookmarks: Announce to screen readers when search results are available

Bug: 735808
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I9449bca20368229dbe9c6e4860ad2ba0467fd0d8
Reviewed-on: https://chromium-review.googlesource.com/567898Reviewed-by: default avatarcalamity <calamity@chromium.org>
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487413}
parent 4a20bad5
...@@ -425,6 +425,9 @@ ...@@ -425,6 +425,9 @@
<message name="IDS_MD_BOOKMARK_MANAGER_ITEMS_SELECTED" desc="Label displayed in bookmark manager toolbar telling the user how many items they have selected."> <message name="IDS_MD_BOOKMARK_MANAGER_ITEMS_SELECTED" desc="Label displayed in bookmark manager toolbar telling the user how many items they have selected.">
<ph name="NUMBER_OF_ITEMS_SELECTED">$1</ph> selected <ph name="NUMBER_OF_ITEMS_SELECTED">$1</ph> selected
</message> </message>
<message name="IDS_MD_BOOKMARK_MANAGER_SEARCH_RESULTS" desc="Message announced by screenreaders when search results are found.">
Search results for '<ph name="SEARCH_STRING">$1<ex>reading</ex></ph>'
</message>
<message name="IDS_MD_BOOKMARK_MANAGER_TITLE" desc="Title of the bookmark manager window."> <message name="IDS_MD_BOOKMARK_MANAGER_TITLE" desc="Title of the bookmark manager window.">
Bookmarks Bookmarks
</message> </message>
......
...@@ -122,6 +122,11 @@ Polymer({ ...@@ -122,6 +122,11 @@ Polymer({
return node.id; return node.id;
}); });
this.dispatch(bookmarks.actions.setSearchResults(ids)); this.dispatch(bookmarks.actions.setSearchResults(ids));
this.fire('iron-announce', {
text: ids.length > 0 ?
loadTimeData.getStringF('searchResults', this.searchTerm_) :
loadTimeData.getString('noSearchResults')
});
}.bind(this)); }.bind(this));
}, },
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
{ {
'target_name': 'app', 'target_name': 'app',
'dependencies': [ 'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
'<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:splitter', '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:splitter',
'<(EXTERNS_GYP):chrome_extensions', '<(EXTERNS_GYP):chrome_extensions',
'api_listener', 'api_listener',
......
...@@ -99,6 +99,8 @@ content::WebUIDataSource* CreateMdBookmarksUIHTMLSource(Profile* profile) { ...@@ -99,6 +99,8 @@ content::WebUIDataSource* CreateMdBookmarksUIHTMLSource(Profile* profile) {
IDS_MD_BOOKMARK_MANAGER_FOLDER_RENAME_TITLE); IDS_MD_BOOKMARK_MANAGER_FOLDER_RENAME_TITLE);
AddLocalizedString(source, "searchPrompt", AddLocalizedString(source, "searchPrompt",
IDS_BOOKMARK_MANAGER_SEARCH_BUTTON); IDS_BOOKMARK_MANAGER_SEARCH_BUTTON);
AddLocalizedString(source, "searchResults",
IDS_MD_BOOKMARK_MANAGER_SEARCH_RESULTS);
AddLocalizedString(source, "saveEdit", IDS_SAVE); AddLocalizedString(source, "saveEdit", IDS_SAVE);
AddLocalizedString(source, "title", IDS_MD_BOOKMARK_MANAGER_TITLE); AddLocalizedString(source, "title", IDS_MD_BOOKMARK_MANAGER_TITLE);
AddLocalizedString(source, "toastFolderSorted", AddLocalizedString(source, "toastFolderSorted",
......
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