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

Unified Diff: content/browser/download/download_manager_impl.cc

Issue 26938003: Don't prompt to save malicious downloads on exit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Testing for CrOS Created 7 years, 2 months 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
Index: content/browser/download/download_manager_impl.cc
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index ad60f8660ed428fb6114bd023e8d91601c4f13d9..c5c3b367ee6f8bb85eaea5d591aadcaf0eef88df 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -673,6 +673,20 @@ int DownloadManagerImpl::InProgressCount() const {
return count;
}
+int DownloadManagerImpl::NonMaliciousInProgressCount() const {
+ int count = 0;
+ for (DownloadMap::const_iterator it = downloads_.begin();
+ it != downloads_.end(); ++it) {
+ if (it->second->GetState() == DownloadItem::IN_PROGRESS &&
+ it->second->GetDangerType() != DOWNLOAD_DANGER_TYPE_DANGEROUS_URL &&
+ it->second->GetDangerType() != DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT &&
+ it->second->GetDangerType() != DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST) {
+ ++count;
+ }
+ }
+ return count;
+}
+
DownloadItem* DownloadManagerImpl::GetDownload(uint32 download_id) {
return ContainsKey(downloads_, download_id) ? downloads_[download_id] : NULL;
}

Powered by Google App Engine
This is Rietveld 408576698