| 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;
|
| }
|
|
|