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

Unified Diff: chrome/browser/download/download_item_model.cc

Issue 147443007: Add support for localized time strings with two units, eg. "2 hours 17 minutes" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More cleanup and documentation Created 6 years, 10 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/browser/download/download_item_model.cc
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
index e1c86df8dd85c0ca3579d6105107979bc09e967a..190ac2f439fe21ae5c076827cd0f3727ecdedf45 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -337,7 +337,8 @@ base::string16 DownloadItemModel::GetTabProgressStatusText() const {
if (download_->IsPaused())
time_remaining = l10n_util::GetStringUTF16(IDS_DOWNLOAD_PROGRESS_PAUSED);
else if (download_->TimeRemaining(&remaining))
- time_remaining = ui::TimeFormat::TimeRemaining(remaining);
+ time_remaining = ui::TimeFormat::Simple(ui::TimeFormat::kRemaining,
bartfab (slow) 2014/02/18 12:04:04 Nit: The else branch now spans multiple lines. Hen
Thiemo Nagel 2014/02/19 17:08:44 Done.
+ ui::TimeFormat::kShort, remaining);
if (time_remaining.empty()) {
base::i18n::AdjustStringForLocaleDirection(&amount);
@@ -627,14 +628,16 @@ base::string16 DownloadItemModel::GetInProgressStatusString() const {
return l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_OPEN_IN,
- ui::TimeFormat::TimeDurationShort(time_remaining));
+ ui::TimeFormat::Simple(ui::TimeFormat::kDuration,
+ ui::TimeFormat::kShort, time_remaining));
}
// In progress download with known time left: "100/120 MB, 10 secs left"
if (time_remaining_known) {
return l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_IN_PROGRESS, size_ratio,
- ui::TimeFormat::TimeRemaining(time_remaining));
+ ui::TimeFormat::Simple(ui::TimeFormat::kRemaining,
+ ui::TimeFormat::kShort, time_remaining));
}
// In progress download with no known time left and non-zero completed bytes:

Powered by Google App Engine
This is Rietveld 408576698