History WebUI: Make screen readers read out that an item was deleted

Bug: 1187232
Change-Id: I69154fdfe301abbbbe28e20037cfa3bf789ab5e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2939365
Reviewed-by: Jochen Eisinger <[email protected]>
Reviewed-by: dpapad <[email protected]>
Commit-Queue: John Lee <[email protected]>
Cr-Commit-Position: refs/heads/master@{#892218}
diff --git a/chrome/browser/resources/history/history_list.ts b/chrome/browser/resources/history/history_list.ts
index c654e4f..e9a15c3d 100644
--- a/chrome/browser/resources/history/history_list.ts
+++ b/chrome/browser/resources/history/history_list.ts
@@ -440,6 +440,11 @@
     const itemData = this.actionMenuModel_!;
 
     this.deleteItems_([itemData.item]).then(() => {
+      IronA11yAnnouncer.requestAvailability();
+      this.fire_(
+          'iron-announce',
+          {text: this.i18n('deleteSuccess', itemData.item.title)});
+
       // This unselect-all resets the toolbar when deleting a selected item
       // and clears selection state which can be invalid if items move
       // around during deletion.
diff --git a/chrome/browser/ui/webui/history/history_ui.cc b/chrome/browser/ui/webui/history/history_ui.cc
index bc02196..c8c62c8 100644
--- a/chrome/browser/ui/webui/history/history_ui.cc
+++ b/chrome/browser/ui/webui/history/history_ui.cc
@@ -65,6 +65,7 @@
       {"clearSearch", IDS_CLEAR_SEARCH},
       {"collapseSessionButton", IDS_HISTORY_OTHER_SESSIONS_COLLAPSE_SESSION},
       {"delete", IDS_HISTORY_DELETE},
+      {"deleteSuccess", IDS_HISTORY_REMOVE_PAGE_SUCCESS},
       {"deleteConfirm", IDS_HISTORY_DELETE_PRIOR_VISITS_CONFIRM_BUTTON},
       {"deleteSession", IDS_HISTORY_OTHER_SESSIONS_HIDE_FOR_NOW},
       {"deleteWarning", IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING},
diff --git a/components/history_strings.grdp b/components/history_strings.grdp
index 321292b..2d9c3b3 100644
--- a/components/history_strings.grdp
+++ b/components/history_strings.grdp
@@ -83,6 +83,9 @@
   <message name="IDS_HISTORY_REMOVE_PAGE" desc="Command in the history entry drop-down menu. Removes a page from the history.">
     Remove from history
   </message>
+  <message name="IDS_HISTORY_REMOVE_PAGE_SUCCESS" desc="Screen reader message that is read after user successfully removes one history item from the item's options menu. The message will reference the page's title.">
+    '<ph name="PAGE_TITLE">$1<ex>Google Store - My Cart</ex></ph>' deleted
+  </message>
   <message name="IDS_HISTORY_REMOVE_SELECTED_ITEMS" desc="Title of the button that allows the user to remove the selected history items">
     Remove selected items
   </message>
diff --git a/components/history_strings_grdp/IDS_HISTORY_REMOVE_PAGE_SUCCESS.png.sha1 b/components/history_strings_grdp/IDS_HISTORY_REMOVE_PAGE_SUCCESS.png.sha1
new file mode 100644
index 0000000..48696ba
--- /dev/null
+++ b/components/history_strings_grdp/IDS_HISTORY_REMOVE_PAGE_SUCCESS.png.sha1
@@ -0,0 +1 @@
+44ed4c504af2df1e1cea0283462d40b76778619e
\ No newline at end of file