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

Unified Diff: chrome/browser/download/download_item_model.cc

Issue 10169025: Show download interrupt reason in a tooltip (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move logic to DownloadItemModel 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/download/download_item_model.cc
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
index 87785ea66190ede4af9ec9db2d819e118a9ea11e..2dc23262222f6c3c5004a69b9a112b892d3b2509 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -150,6 +150,20 @@ string16 DownloadItemModel::GetStatusText() {
return status_text;
}
+string16 DownloadItemModel::GetTooltipText(const gfx::Font& font,
+ int max_width) const {
+ string16 tooltip = ui::ElideFilename(
+ download_->GetFileNameToReportUser(), font, max_width);
+ content::DownloadInterruptReason reason = download_->GetLastReason();
+ if (download_->GetState() == DownloadItem::INTERRUPTED &&
+ reason != content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED) {
+ tooltip += ASCIIToUTF16("\n");
+ tooltip += ui::ElideText(InterruptReasonStatusMessage(reason),
+ font, max_width, ui::ELIDE_AT_END);
+ }
+ return tooltip;
+}
+
int DownloadItemModel::PercentComplete() const {
#if defined(OS_CHROMEOS)
// For GData uploads, progress is based on the number of bytes
« no previous file with comments | « chrome/browser/download/download_item_model.h ('k') | chrome/browser/download/download_item_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698