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

Unified Diff: chrome/browser/ui/cocoa/download/download_item_controller.mm

Issue 10169025: Show download interrupt reason in a tooltip (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits 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/cocoa/download/download_item_controller.mm
diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm
index faac76d7ef690268f108ad453d8df683d24d9334..a406a8d0be279b231e2288dd9dae71c47720dc51 100644
--- a/chrome/browser/ui/cocoa/download/download_item_controller.mm
+++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm
@@ -245,9 +245,19 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
}
- (void)updateToolTip {
- string16 elidedFilename = ui::ElideFilename(
+ string16 tooltip_text = ui::ElideFilename(
[self download]->GetFileNameToReportUser(), *font_, kToolTipMaxWidth);
- [progressView_ setToolTip:base::SysUTF16ToNSString(elidedFilename)];
+
+ if ([self download]->GetState() == content::DownloadItem::INTERRUPTED) {
+ content::DownloadInterruptReason reason = [self download]->GetLastReason();
+ DCHECK_NE(0, reason);
+
+ // Add the status on another line.
+ tooltip_text += ASCIIToUTF16("\n");
+ tooltip_text += DownloadItemModel::InterruptReasonStatusMessage(reason);
+ }
+
+ [progressView_ setToolTip:base::SysUTF16ToNSString(tooltip_text)];
}
- (void)clearDangerousMode {

Powered by Google App Engine
This is Rietveld 408576698