OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/download/download_file.h" | 5 #include "chrome/browser/download/download_file.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 #if defined(OS_WIN) | 141 #if defined(OS_WIN) |
142 AnnotateWithSourceInformation(); | 142 AnnotateWithSourceInformation(); |
143 #endif | 143 #endif |
144 return true; | 144 return true; |
145 } | 145 } |
146 | 146 |
147 void DownloadFile::AnnotateWithSourceInformation() { | 147 void DownloadFile::AnnotateWithSourceInformation() { |
148 #if defined(OS_WIN) | 148 #if defined(OS_WIN) |
149 // Sets the Zone to tell Windows that this file comes from the internet. | 149 // Sets the Zone to tell Windows that this file comes from the internet. |
150 // We ignore the return value because a failure is not fatal. | 150 // We ignore the return value because a failure is not fatal. |
151 win_util::SetInternetZoneIdentifier(full_path_); | 151 win_util::SetInternetZoneIdentifier(full_path_, |
| 152 UTF8ToWide(source_url_.spec())); |
152 #elif defined(OS_MACOSX) | 153 #elif defined(OS_MACOSX) |
153 file_metadata::AddQuarantineMetadataToFile(full_path_, source_url_, | 154 file_metadata::AddQuarantineMetadataToFile(full_path_, source_url_, |
154 referrer_url_); | 155 referrer_url_); |
155 file_metadata::AddOriginMetadataToFile(full_path_, source_url_, | 156 file_metadata::AddOriginMetadataToFile(full_path_, source_url_, |
156 referrer_url_); | 157 referrer_url_); |
157 #endif | 158 #endif |
158 } | 159 } |
159 | 160 |
160 // DownloadFileManager implementation ------------------------------------------ | 161 // DownloadFileManager implementation ------------------------------------------ |
161 | 162 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 NewRunnableMethod(this, &DownloadFileManager::StopUpdateTimer)); | 632 NewRunnableMethod(this, &DownloadFileManager::StopUpdateTimer)); |
632 } | 633 } |
633 } | 634 } |
634 | 635 |
635 // static | 636 // static |
636 void DownloadFileManager::DeleteFile(const FilePath& path) { | 637 void DownloadFileManager::DeleteFile(const FilePath& path) { |
637 // Make sure we only delete files. | 638 // Make sure we only delete files. |
638 if (!file_util::DirectoryExists(path)) | 639 if (!file_util::DirectoryExists(path)) |
639 file_util::Delete(path, false); | 640 file_util::Delete(path, false); |
640 } | 641 } |
OLD | NEW |