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

Unified Diff: chrome/browser/ui/gtk/download/download_item_gtk.cc

Issue 9968090: Added download error descriptions to tooltips for Mac & Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed tooltip to using the short error status string. Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
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..86d26aa2be295581eb96e3aed765efc9225b966d 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(reason != 0);
+
+ // Add the status on another line.
+ tooltip_text += ASCIIToUTF16("\n");
+ tooltip_text += DownloadItemModel::InterruptReasonStatusMessage(reason);
+ }
+
+ gtk_widget_set_tooltip_text(body_.get(), UTF16ToUTF8(tooltip_text).c_str());
}
void DownloadItemGtk::UpdateNameLabel() {

Powered by Google App Engine
This is Rietveld 408576698