summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_item.h
diff options
context:
space:
mode:
authorlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-26 00:11:35 +0000
committerlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-26 00:11:35 +0000
commit287b86bfa8405f38377eb4b6c33c28b8a926fb2a (patch)
treef6c1d0e24dcbcf10f0bccec3b5688c623c49137b /chrome/browser/download/download_item.h
parent144259d6f653fe03ec889d24605e60a00e5a28a0 (diff)
downloadchromium_src-287b86bfa8405f38377eb4b6c33c28b8a926fb2a.zip
chromium_src-287b86bfa8405f38377eb4b6c33c28b8a926fb2a.tar.gz
chromium_src-287b86bfa8405f38377eb4b6c33c28b8a926fb2a.tar.bz2
Enable url check in download_manager, with a simple UI (it may need polish). The whole thing is still behind a flag.
The download_file_manager will start a url check with safebrowsing. It goes parallel with file creation operation. When url is checked to be dangerous, the UI dialog will show the dialog. TEST=download_manager_unittest BUG=60822 Review URL: http://codereview.chromium.org/6410050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_item.h')
-rw-r--r--chrome/browser/download/download_item.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome/browser/download/download_item.h b/chrome/browser/download/download_item.h
index eaa9a55..5eadea8 100644
--- a/chrome/browser/download/download_item.h
+++ b/chrome/browser/download/download_item.h
@@ -62,6 +62,17 @@ class DownloadItem {
DANGEROUS_BUT_VALIDATED // Dangerous but the user confirmed the download.
};
+ enum DangerType {
+ NOT_DANGEROUS = 0,
+
+ // A dangerous file to the system (e.g.: an executable or extension from
+ // places other than gallery).
+ DANGEROUS_FILE,
+
+ // Safebrowsing service shows this URL leads to malicious file download.
+ DANGEROUS_URL
+ };
+
// Interface that observers of a particular download must implement in order
// to receive updates to the download's status.
class Observer {
@@ -174,7 +185,8 @@ class DownloadItem {
// result of analyzing the file and figuring out its type, location, etc.
// May only be called once.
void SetFileCheckResults(const FilePath& path,
- bool is_dangerous,
+ bool is_dangerous_file,
+ bool is_dangerous_url,
int path_uniquifier,
bool prompt,
bool is_extension_install,
@@ -226,6 +238,7 @@ class DownloadItem {
void set_safety_state(SafetyState safety_state) {
safety_state_ = safety_state;
}
+ DangerType danger_type() { return danger_type_;}
bool auto_opened() { return auto_opened_; }
FilePath target_name() const { return target_name_; }
bool save_as() const { return save_as_; }
@@ -329,6 +342,9 @@ class DownloadItem {
// (executable files are typically considered dangerous).
SafetyState safety_state_;
+ // Why |safety_state_| is not SAFE.
+ DangerType danger_type_;
+
// Whether the download was auto-opened. We set this rather than using
// an observer as it's frequently possible for the download to be auto opened
// before the observer is added.