Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerToolbar.java

Issue 2617413003: [Android History] Add accessibility support (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerToolbar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerToolbar.java
index d7ed967079621121bd97398da30f656ee121ee7e..e50ae71127ffc3d45ddd8c118c6308e92e00cc20 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerToolbar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerToolbar.java
@@ -46,7 +46,6 @@ public class HistoryManagerToolbar extends SelectionToolbar<HistoryItem>
inflateMenu(R.menu.history_manager_menu);
updateMenuItemVisibility();
- // TODO(twellington): Add content descriptions to the number roll view.
}
@Override
@@ -121,8 +120,21 @@ public class HistoryManagerToolbar extends SelectionToolbar<HistoryItem>
boolean wasSelectionEnabled = mIsSelectionEnabled;
super.onSelectionStateChange(selectedItems);
- if (!wasSelectionEnabled && mIsSelectionEnabled) {
- mManager.recordUserActionWithOptionalSearch("SelectionEstablished");
+ if (mIsSelectionEnabled) {
+ int numSelected = mSelectionDelegate.getSelectedItems().size();
+
+ // If the delete menu item is shown in the overflow menu instead of as an action, there
+ // may not be a view associated with it.
+ View deleteButton = findViewById(R.id.selection_mode_delete_menu_id);
+ if (deleteButton != null) {
+ deleteButton.setContentDescription(getResources().getQuantityString(
+ R.plurals.accessibility_remove_selected_items,
+ numSelected, numSelected));
+ }
+
+ if (!wasSelectionEnabled) {
+ mManager.recordUserActionWithOptionalSearch("SelectionEstablished");
+ }
}
if (!mIsSearching) return;

Powered by Google App Engine
This is Rietveld 408576698