Chromium Code Reviews| Index: chrome/browser/ui/gtk/download/download_item_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/download/download_item_gtk.cc b/chrome/browser/ui/gtk/download/download_item_gtk.cc |
| index 92be0bb60486a668509acc632f2d1dd09b1f256f..e7cf68e9df0d9ff96a958b182d636a8735f1de9b 100644 |
| --- a/chrome/browser/ui/gtk/download/download_item_gtk.cc |
| +++ b/chrome/browser/ui/gtk/download/download_item_gtk.cc |
| @@ -335,6 +335,7 @@ void DownloadItemGtk::OnDownloadUpdated(DownloadItem* download) { |
| break; |
| case DownloadItem::INTERRUPTED: |
| StopDownloadProgress(); |
| + UpdateTooltip(); |
| complete_animation_.Show(); |
| break; |
| @@ -476,11 +477,19 @@ void DownloadItemGtk::LoadIcon() { |
| } |
| void DownloadItemGtk::UpdateTooltip() { |
| - string16 elided_filename = ui::ElideFilename( |
| - get_download()->GetFileNameToReportUser(), |
| - gfx::Font(), kTooltipMaxWidth); |
| - gtk_widget_set_tooltip_text(body_.get(), |
| - UTF16ToUTF8(elided_filename).c_str()); |
| + string16 tooltip_text = ui::ElideFilename( |
| + get_download()->GetFileNameToReportUser(), gfx::Font(), kTooltipMaxWidth); |
| + |
| + if (get_download()->GetState() == content::DownloadItem::INTERRUPTED) { |
| + content::DownloadInterruptReason reason = get_download()->GetLastReason(); |
| + DCHECK_NE(0, reason); |
| + |
| + // Add the status on another line. |
| + tooltip_text += ASCIIToUTF16("\n"); |
| + tooltip_text += DownloadItemModel::InterruptReasonStatusMessage(reason); |
| + } |
|
Nico
2012/04/23 23:25:04
This bit of code is very similar on all UIs. Maybe
|
| + |
| + gtk_widget_set_tooltip_text(body_.get(), UTF16ToUTF8(tooltip_text).c_str()); |
| } |
| void DownloadItemGtk::UpdateNameLabel() { |