summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_item.h
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 23:21:01 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 23:21:01 +0000
commit30307700ac157552793f3370b9dd53373015ac55 (patch)
tree593c62a5995d31e9ca8bfea0760835848604d2c9 /chrome/browser/download/download_item.h
parentabe92999c62ebc866b8a0451b3a1eb1d71e37391 (diff)
downloadchromium_src-30307700ac157552793f3370b9dd53373015ac55.zip
chromium_src-30307700ac157552793f3370b9dd53373015ac55.tar.gz
chromium_src-30307700ac157552793f3370b9dd53373015ac55.tar.bz2
Add enum histogram for dangerous download save or discard.
BUG=79490 TEST=save or discard a dangerous download, check about:histograms Review URL: http://codereview.chromium.org/6849004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82186 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_item.h')
-rw-r--r--chrome/browser/download/download_item.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/chrome/browser/download/download_item.h b/chrome/browser/download/download_item.h
index e90dbf51..5340027 100644
--- a/chrome/browser/download/download_item.h
+++ b/chrome/browser/download/download_item.h
@@ -62,6 +62,8 @@ class DownloadItem {
DANGEROUS_BUT_VALIDATED // Dangerous but the user confirmed the download.
};
+ // This enum is used by histograms. Do not change the ordering or remove
+ // items.
enum DangerType {
NOT_DANGEROUS = 0,
@@ -70,7 +72,17 @@ class DownloadItem {
DANGEROUS_FILE,
// Safebrowsing service shows this URL leads to malicious file download.
- DANGEROUS_URL
+ DANGEROUS_URL,
+
+ // Memory space for histograms is determined by the max.
+ // ALWAYS ADD NEW VALUES BEFORE THIS ONE.
+ DANGEROUS_TYPE_MAX
+ };
+
+ // Reason for deleting the download. Passed to Delete().
+ enum DeleteReason {
+ DELETE_DUE_TO_BROWSER_SHUTDOWN = 0,
+ DELETE_DUE_TO_USER_DISCARD
};
// Interface that observers of a particular download must implement in order
@@ -156,9 +168,14 @@ class DownloadItem {
// code that the operation received.
void Interrupted(int64 size, int os_error);
- // The user wants to remove the download from the views and history. If
- // |delete_file| is true, the file is deleted on the disk.
- void Remove(bool delete_file);
+ // Deletes the file from disk and removes the download from the views and
+ // history. |user| should be true if this is the result of the user clicking
+ // the discard button, and false if it is being deleted for other reasons like
+ // browser shutdown.
+ void Delete(DeleteReason reason);
+
+ // Removes the download from the views and history.
+ void Remove();
// Simple calculation of the amount of time remaining to completion. Fills
// |*remaining| with the amount of time remaining if successful. Fails and