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

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

Issue 3127008: Preliminary work on resuming downloads whose connections have expired.
Patch Set: Waiting to send download automation error message until after other downloads are canceled. Created 10 years, 3 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/i18n/number_formatting.h" 8 #include "base/i18n/number_formatting.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 break; 79 break;
80 case DownloadItem::COMPLETE: 80 case DownloadItem::COMPLETE:
81 status_text.clear(); 81 status_text.clear();
82 break; 82 break;
83 case DownloadItem::CANCELLED: 83 case DownloadItem::CANCELLED:
84 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_CANCELED); 84 status_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_CANCELED);
85 break; 85 break;
86 case DownloadItem::REMOVING: 86 case DownloadItem::REMOVING:
87 break; 87 break;
88 case DownloadItem::INTERRUPTED:
89 status_text = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_STATUS_INTERRUPTED,
90 simple_size,
91 simple_total);
92 break;
88 default: 93 default:
89 NOTREACHED(); 94 NOTREACHED();
90 } 95 }
91 96
92 return UTF16ToWideHack(status_text); 97 return UTF16ToWideHack(status_text);
93 } 98 }
94 99
95 // ----------------------------------------------------------------------------- 100 // -----------------------------------------------------------------------------
96 // SavePageModel 101 // SavePageModel
97 102
(...skipping 19 matching lines...) Expand all
117 UTF16ToWide(base::FormatNumber(total_size))); 122 UTF16ToWide(base::FormatNumber(total_size)));
118 break; 123 break;
119 case DownloadItem::COMPLETE: 124 case DownloadItem::COMPLETE:
120 status_text = l10n_util::GetString(IDS_SAVE_PAGE_STATUS_COMPLETED); 125 status_text = l10n_util::GetString(IDS_SAVE_PAGE_STATUS_COMPLETED);
121 break; 126 break;
122 case DownloadItem::CANCELLED: 127 case DownloadItem::CANCELLED:
123 status_text = l10n_util::GetString(IDS_SAVE_PAGE_STATUS_CANCELED); 128 status_text = l10n_util::GetString(IDS_SAVE_PAGE_STATUS_CANCELED);
124 break; 129 break;
125 case DownloadItem::REMOVING: 130 case DownloadItem::REMOVING:
126 break; 131 break;
132 case DownloadItem::INTERRUPTED:
133 status_text = l10n_util::GetStringF(
134 IDS_SAVE_PAGE_STATUS_INTERRUPTED,
135 UTF16ToWide(base::FormatNumber(size)),
136 UTF16ToWide(base::FormatNumber(total_size)));
137 break;
127 default: 138 default:
128 NOTREACHED(); 139 NOTREACHED();
129 } 140 }
130 141
131 return status_text; 142 return status_text;
132 } 143 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698