| Index: chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java
|
| index 0ebad5c01f240cd9d29e58e7dbad284c77f2ac7e..1e0080232698786a03e41b8bc2ecebc1350a17dd 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java
|
| @@ -8,6 +8,7 @@ import android.content.Context;
|
| import android.support.annotation.Nullable;
|
| import android.support.v4.widget.DrawerLayout;
|
| import android.util.AttributeSet;
|
| +import android.view.View;
|
|
|
| import org.chromium.base.metrics.RecordUserAction;
|
| import org.chromium.chrome.R;
|
| @@ -38,8 +39,6 @@ public class DownloadManagerToolbar extends SelectionToolbar<DownloadHistoryItem
|
| }
|
|
|
| super.initialize(delegate, titleResId, drawerLayout, normalGroupResId, selectedGroupResId);
|
| -
|
| - mNumberRollView.setContentDescriptionString(R.plurals.accessibility_selected_items);
|
| }
|
|
|
| @Override
|
| @@ -57,12 +56,22 @@ public class DownloadManagerToolbar extends SelectionToolbar<DownloadHistoryItem
|
| updateTitle();
|
| } else {
|
| int numSelected = mSelectionDelegate.getSelectedItems().size();
|
| - findViewById(R.id.selection_mode_share_menu_id).setContentDescription(
|
| - getResources().getQuantityString(R.plurals.accessibility_share_selected_items,
|
| - numSelected, numSelected));
|
| - findViewById(R.id.selection_mode_delete_menu_id).setContentDescription(
|
| - getResources().getQuantityString(R.plurals.accessibility_remove_selected_items,
|
| - numSelected, numSelected));
|
| +
|
| + // If the share or delete menu items are shown in the overflow menu instead of as an
|
| + // action, there may not be views associated with them.
|
| + View shareButton = findViewById(R.id.selection_mode_share_menu_id);
|
| + if (shareButton != null) {
|
| + shareButton.setContentDescription(getResources().getQuantityString(
|
| + R.plurals.accessibility_share_selected_items,
|
| + numSelected, numSelected));
|
| + }
|
| +
|
| + 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) {
|
| RecordUserAction.record("Android.DownloadManager.SelectionEstablished");
|
|
|