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

Side by Side Diff: chrome/browser/download/download_item_model.cc

Issue 10665049: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/download/download_item_model.h" 5 #include "chrome/browser/download/download_item_model.h"
6 6
7 #include "base/i18n/number_formatting.h" 7 #include "base/i18n/number_formatting.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 case DownloadItem::COMPLETE: 121 case DownloadItem::COMPLETE:
122 if (download_->GetFileExternallyRemoved()) { 122 if (download_->GetFileExternallyRemoved()) {
123 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_REMOVED); 123 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_REMOVED);
124 } else { 124 } else {
125 status_text.clear(); 125 status_text.clear();
126 } 126 }
127 break; 127 break;
128 case DownloadItem::CANCELLED: 128 case DownloadItem::CANCELLED:
129 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_CANCELLED); 129 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_CANCELLED);
130 break; 130 break;
131 case DownloadItem::REMOVING:
132 break;
133 case DownloadItem::INTERRUPTED: 131 case DownloadItem::INTERRUPTED:
134 reason = download_->GetLastReason(); 132 reason = download_->GetLastReason();
135 status_text = InterruptReasonStatusMessage(reason); 133 status_text = InterruptReasonStatusMessage(reason);
136 if (total <= 0) { 134 if (total <= 0) {
137 size_text = ui::FormatBytes(size); 135 size_text = ui::FormatBytes(size);
138 } else { 136 } else {
139 size_text = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_RECEIVED_SIZE, 137 size_text = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_RECEIVED_SIZE,
140 simple_size, 138 simple_size,
141 simple_total); 139 simple_total);
142 } 140 }
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 break; 359 break;
362 default: 360 default:
363 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS; 361 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS;
364 break; 362 break;
365 } 363 }
366 364
367 status_text = l10n_util::GetStringUTF16(string_id); 365 status_text = l10n_util::GetStringUTF16(string_id);
368 366
369 return status_text; 367 return status_text;
370 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698