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

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

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
« no previous file with comments | « no previous file | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_item_model.h
diff --git a/chrome/browser/download/download_item_model.h b/chrome/browser/download/download_item_model.h
index bddf911174a547b5a59554e051285e94747099c9..5a0e08e5364b76b37c73b35aaf6c718b1b224ee0 100644
--- a/chrome/browser/download/download_item_model.h
+++ b/chrome/browser/download/download_item_model.h
@@ -32,9 +32,21 @@ class BaseDownloadItemModel {
// Cancel the task corresponding to the item.
virtual void CancelTask() = 0;
- // Get the status text to display.
+ // Returns a short one-line status string for the download.
virtual string16 GetStatusText() = 0;
+ // Returns a string suitable for use as a tooltip. For a regular download, the
+ // tooltip is the filename. For an interrupted download, the string states the
+ // filename and a short description of the reason for interruption. For
+ // example:
+ // Report.pdf
+ // Network disconnected
+ // |font| and |max_width| are used to elide the filename and/or interrupt
+ // reason as necessary to keep the width of the tooltip text under
+ // |max_width|. The tooltip will be at most 2 lines.
+ virtual string16 GetTooltipText(const gfx::Font& font,
+ int max_width) const = 0;
+
// Rough percent complete. Returns -1 if the progress is unknown.
virtual int PercentComplete() const = 0;
@@ -75,6 +87,8 @@ class DownloadItemModel : public BaseDownloadItemModel {
// BaseDownloadItemModel
virtual void CancelTask() OVERRIDE;
virtual string16 GetStatusText() OVERRIDE;
+ virtual string16 GetTooltipText(const gfx::Font& font,
+ int max_width) const OVERRIDE;
virtual int PercentComplete() const OVERRIDE;
virtual string16 GetWarningText(const gfx::Font& font,
int base_width) OVERRIDE;
« no previous file with comments | « no previous file | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698