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

Unified Diff: content/browser/download/download_state_info.h

Issue 8468020: Propagate the SafeBrowsing download protection verdict to the DownloadItem. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix typo Created 9 years, 1 month 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 | « content/browser/download/download_item.cc ('k') | content/browser/download/download_state_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_state_info.h
diff --git a/content/browser/download/download_state_info.h b/content/browser/download/download_state_info.h
index 0729fe2089ef0208cc4a4372e2b9f3245b6c8f76..a59d7c78947f4fe857a8b000aa96d084a1a386a8 100644
--- a/content/browser/download/download_state_info.h
+++ b/content/browser/download/download_state_info.h
@@ -13,6 +13,32 @@
// Contains information relating to the process of determining what to do with
// the download.
struct DownloadStateInfo {
+ // This enum is also used by histograms. Do not change the ordering or remove
+ // items.
+ enum DangerType {
Randy Smith (Not in Mondays) 2011/11/17 16:49:31 Given the choice, I'd rather this enum was in Down
noelutz 2011/11/17 17:05:44 I thought of that but then you have a circular inc
+ // The download is safe.
+ NOT_DANGEROUS = 0,
+
+ // A dangerous file to the system (e.g.: a pdf or extension from
+ // places other than gallery).
+ DANGEROUS_FILE,
+
+ // Safebrowsing download service shows this URL leads to malicious file
+ // download.
+ DANGEROUS_URL,
+
+ // SafeBrowsing download service shows this file content as being malicious.
+ DANGEROUS_CONTENT,
+
+ // The content of this download may be malicious (e.g., extension is exe but
+ // SafeBrowsing has not finished checking the content).
+ MAYBE_DANGEROUS_CONTENT,
+
+ // Memory space for histograms is determined by the max.
+ // ALWAYS ADD NEW VALUES BEFORE THIS ONE.
+ DANGEROUS_TYPE_MAX
+ };
+
DownloadStateInfo();
DownloadStateInfo(bool has_user_gesture,
bool prompt_user_for_save_location);
@@ -22,8 +48,7 @@ struct DownloadStateInfo {
content::PageTransition transition_type,
bool prompt_user_for_save_location,
int uniquifier,
- bool dangerous_file,
- bool dangerous_url);
+ DangerType danger);
// Indicates if the download is dangerous.
CONTENT_EXPORT bool IsDangerous() const;
@@ -50,11 +75,7 @@ struct DownloadStateInfo {
// default location.
bool prompt_user_for_save_location;
- // True if this download file is potentially dangerous (ex: exe, dll, ...).
- bool is_dangerous_file;
-
- // If safebrowsing believes this URL leads to malware.
- bool is_dangerous_url;
+ DangerType danger;
// True if this download's file name was specified initially.
FilePath force_file_name;
« no previous file with comments | « content/browser/download/download_item.cc ('k') | content/browser/download/download_state_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698