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

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

Issue 4693005: Set the download rate to 0B/s if the download is paused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser
Patch Set: Code review Created 10 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 489cb78786cf71be99b55f846224a77042484ebb..193ccaa9778cc7c823d15bc9cd4d50665652c8e3 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -582,10 +582,16 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
} else {
amount.assign(received_size);
}
- amount_units = GetByteDisplayUnits(download->CurrentSpeed());
- std::wstring speed_text =
- UTF16ToWideHack(FormatSpeed(download->CurrentSpeed(), amount_units,
- true));
+ std::wstring speed_text;
+ if (download->is_paused()) {
Paweł Hajdan Jr. 2010/11/10 12:14:02 This seems wrong. Why not do that in download->Cur
+ // If the download is paused, set the rate to 0B/s.
+ amount_units = GetByteDisplayUnits(0);
+ speed_text = UTF16ToWideHack(FormatSpeed(0, amount_units, true));
+ } else {
+ amount_units = GetByteDisplayUnits(download->CurrentSpeed());
+ speed_text = UTF16ToWideHack(FormatSpeed(download->CurrentSpeed(),
+ amount_units, true));
+ }
std::wstring speed_text_localized;
if (base::i18n::AdjustStringForLocaleDirection(speed_text,
&speed_text_localized))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698