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

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: Updated comments 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..3fef4933ccb22ea7330cf5a991692a1dddb5270b 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -673,6 +673,21 @@ int DownloadManagerImpl::InProgressCount() const {
return count;
}
+int DownloadManagerImpl::NonDangerousInProgressCount() const {
+ int count = 0;
+ for (DownloadMap::const_iterator it = downloads_.begin();
+ it != downloads_.end(); ++it) {
+ // Exclude dangerous items, unless they are
+ // DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE
+ if ((it->second->GetState() == DownloadItem::IN_PROGRESS) &&
+ !(it->second->IsDangerous() &&
+ (it->second->GetDangerType() != DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE))) {
+ ++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