Skip to content

Commit

Permalink
[M110] Make in-progress download updates unique
Browse files Browse the repository at this point in the history
This CL adds the filename to the accessible alerts for in-progress
downloads so that alerts for multiple in-progress downloads can be
distinguished.

(cherry picked from commit f2c0eb5)

Bug: 1394858
Change-Id: Iafb5d941d48fbb5af66fda0efb58ba9e14ca1ee7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4114747
Reviewed-by: Min Qin <qinmin@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1085158}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4158171
Auto-Submit: Daniel Rubery <drubery@chromium.org>
Reviewed-by: Xinghui Lu <xinghuilu@chromium.org>
Cr-Commit-Position: refs/branch-heads/5481@{#286}
Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
  • Loading branch information
Daniel Rubery authored and Chromium LUCI CQ committed Jan 13, 2023
1 parent 60fb9de commit d0a6518
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -2220,11 +2220,11 @@ are declared in tools/grit/grit_rule.gni.
</message>
<message name="IDS_DOWNLOAD_STATUS_PERCENT_COMPLETE_ACCESSIBLE_ALERT"
desc="The title of a download notification: the current download status is in progress and time remaining is known. This message is for screen reader users.">
Downloading, <ph name="PERCENT_REMAINING">$1<ex>33</ex></ph>% remaining
Downloading <ph name="FILE_NAME">$1<ex>somedocument.pdf</ex></ph>, <ph name="PERCENT_REMAINING">$2<ex>33</ex></ph>% remaining
</message>
<message name="IDS_DOWNLOAD_STATUS_TIME_REMAINING_ACCESSIBLE_ALERT"
desc="The title of a download notification: the current download status is in progress and time remaining is known. This message is for screen reader users.">
Downloading, <ph name="STATUS">$1<ex>42 mins left</ex></ph>
Downloading <ph name="FILE_NAME">$1<ex>somedocument.pdf</ex></ph>, <ph name="STATUS">$2<ex>42 mins left</ex></ph>
</message>
<message name="IDS_DOWNLOAD_FAILED_ACCESSIBLE_ALERT"
desc="The title of a download notification: the current download status is failed. This message is for screen reader users.">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b5c24d26a89199dc1d53610c52329412d9727628
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b5c24d26a89199dc1d53610c52329412d9727628
8 changes: 5 additions & 3 deletions chrome/browser/download/download_ui_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1793,15 +1793,17 @@ std::u16string DownloadUIModel::GetInProgressAccessibleAlertText() const {
ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_REMAINING,
ui::TimeFormat::LENGTH_SHORT, remaining);
return l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_TIME_REMAINING_ACCESSIBLE_ALERT, remaining_string);
IDS_DOWNLOAD_STATUS_TIME_REMAINING_ACCESSIBLE_ALERT,
GetFileNameToReportUser().LossyDisplayName(), remaining_string);
}

// Time remaining is unknown, try to announce percent remaining.
if (PercentComplete() > 0) {
DCHECK_LE(PercentComplete(), 100);
return l10n_util::GetStringFUTF16Int(
return l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_PERCENT_COMPLETE_ACCESSIBLE_ALERT,
100 - PercentComplete());
GetFileNameToReportUser().LossyDisplayName(),
base::FormatNumber(100 - PercentComplete()));
}

// Percent remaining is also unknown, announce bytes to download.
Expand Down

0 comments on commit d0a6518

Please sign in to comment.