summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-27 21:11:34 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-27 21:11:34 +0000
commit8ef0637fffc0ad76943be9a6e3bd72b9e5fab07b (patch)
tree8ac751eacc58518b541b9312b4f9a48528781bd8 /chrome/browser/download
parent440a4cc75da5e520fd25c5ef0c0b22823b6ca1b4 (diff)
downloadchromium_src-8ef0637fffc0ad76943be9a6e3bd72b9e5fab07b.zip
chromium_src-8ef0637fffc0ad76943be9a6e3bd72b9e5fab07b.tar.gz
chromium_src-8ef0637fffc0ad76943be9a6e3bd72b9e5fab07b.tar.bz2
Add quarantine metadata to downloads on the Mac. Patch by Stuart Morgan
<stuart.morgan@gmail.com>. BUG=10853 Code review URL: http://codereview.chromium.org/99005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_file.cc7
-rw-r--r--chrome/browser/download/download_file.h6
2 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc
index bd10ad7..89b468c 100644
--- a/chrome/browser/download/download_file.cc
+++ b/chrome/browser/download/download_file.cc
@@ -26,6 +26,8 @@
#if defined(OS_WIN)
#include "chrome/common/win_util.h"
#include "chrome/common/win_safe_util.h"
+#elif defined(OS_MACOSX)
+#include "chrome/common/quarantine_mac.h"
#endif
// Throttle updates to the UI thread so that a fast moving download doesn't
@@ -54,6 +56,8 @@ class DownloadFileUpdateTask : public Task {
DownloadFile::DownloadFile(const DownloadCreateInfo* info)
: file_(NULL),
+ source_url_(info->url),
+ referrer_url_(info->referrer_url),
id_(info->download_id),
render_process_id_(info->render_process_id),
render_view_id_(info->render_view_id),
@@ -136,7 +140,8 @@ bool DownloadFile::Open(const char* open_mode) {
// We ignore the return value because a failure is not fatal.
win_util::SetInternetZoneIdentifier(full_path_);
#elif defined(OS_MACOSX)
- // TODO(port): Set quarrantine information, http://crbug.com/10853
+ quarantine_mac::AddQuarantineMetadataToFile(full_path_, source_url_,
+ referrer_url_);
#endif
return true;
}
diff --git a/chrome/browser/download/download_file.h b/chrome/browser/download/download_file.h
index 82f7597..0b3bc31 100644
--- a/chrome/browser/download/download_file.h
+++ b/chrome/browser/download/download_file.h
@@ -121,6 +121,12 @@ class DownloadFile {
// OS file handle for writing
FILE* file_;
+ // Source URL for the file being downloaded.
+ GURL source_url_;
+
+ // The URL where the download was initiated.
+ GURL referrer_url_;
+
// The unique identifier for this download, assigned at creation by
// the DownloadFileManager for its internal record keeping.
int id_;