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

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

Issue 6905049: Detect removed files and reflect the state in chrome://downloads and the download shelf (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge with the latest revision Created 9 years, 6 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
« no previous file with comments | « chrome/browser/download/download_item.cc ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_STARTING) : 75 l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_STARTING) :
76 FormatBytes(size, GetByteDisplayUnits(size), true); 76 FormatBytes(size, GetByteDisplayUnits(size), true);
77 } else { 77 } else {
78 status_text = l10n_util::GetStringFUTF16( 78 status_text = l10n_util::GetStringFUTF16(
79 IDS_DOWNLOAD_STATUS_IN_PROGRESS, simple_size, simple_total, 79 IDS_DOWNLOAD_STATUS_IN_PROGRESS, simple_size, simple_total,
80 simple_time); 80 simple_time);
81 } 81 }
82 } 82 }
83 break; 83 break;
84 case DownloadItem::COMPLETE: 84 case DownloadItem::COMPLETE:
85 status_text.clear(); 85 if (download_->file_externally_removed()) {
86 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_REMOVED);
87 } else {
88 status_text.clear();
89 }
86 break; 90 break;
87 case DownloadItem::CANCELLED: 91 case DownloadItem::CANCELLED:
88 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_CANCELED); 92 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_CANCELED);
89 break; 93 break;
90 case DownloadItem::REMOVING: 94 case DownloadItem::REMOVING:
91 break; 95 break;
92 case DownloadItem::INTERRUPTED: 96 case DownloadItem::INTERRUPTED:
93 status_text = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_STATUS_INTERRUPTED, 97 status_text = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_STATUS_INTERRUPTED,
94 simple_size, 98 simple_size,
95 simple_total); 99 simple_total);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 IDS_SAVE_PAGE_STATUS_INTERRUPTED, 142 IDS_SAVE_PAGE_STATUS_INTERRUPTED,
139 base::FormatNumber(size), 143 base::FormatNumber(size),
140 base::FormatNumber(total_size)); 144 base::FormatNumber(total_size));
141 break; 145 break;
142 default: 146 default:
143 NOTREACHED(); 147 NOTREACHED();
144 } 148 }
145 149
146 return status_text; 150 return status_text;
147 } 151 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_item.cc ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698