Index: chrome/browser/download/chrome_download_manager_delegate.cc |
=================================================================== |
--- chrome/browser/download/chrome_download_manager_delegate.cc (revision 107068) |
+++ chrome/browser/download/chrome_download_manager_delegate.cc (working copy) |
@@ -225,8 +225,28 @@ |
DownloadItem* item, |
const FilePath& new_path) { |
download_history_->UpdateDownloadPath(item, new_path); |
+ |
+#if defined(ENABLE_SAFE_BROWSING) |
+ // Begin the safe browsing download protection check. |
+ SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); |
+ if (sb_service && sb_service->download_protection_service()) { |
+ using safe_browsing::DownloadProtectionService; |
+ sb_service->download_protection_service()->CheckClientDownload( |
+ DownloadProtectionService::DownloadInfo::FromDownloadItem(*item), |
+ base::Bind(&ChromeDownloadManagerDelegate::CheckClientDownloadDone, |
+ this)); |
+ } |
+#else |
+ // Assume safe. |
+ CheckClientDownloadDone(safe_browsing::DownloadProtectionService::SAFE); |
+#endif |
} |
+void ChromeDownloadManagerDelegate::CheckClientDownloadDone( |
+ safe_browsing::DownloadProtectionService::DownloadCheckResult result) { |
+ // TODO(bryner): notify the user based on this result |
+} |
+ |
void ChromeDownloadManagerDelegate::RemoveItemFromPersistentStore( |
DownloadItem* item) { |
download_history_->RemoveEntry(item); |