Index: chrome/browser/download/notification/download_group_notification.cc |
diff --git a/chrome/browser/download/notification/download_group_notification.cc b/chrome/browser/download/notification/download_group_notification.cc |
index 2b578f523d96d21ac29ff8e0d084f8fb43d7ca65..a8ef43a85ee1f4cd78a28b76917756070618a28a 100644 |
--- a/chrome/browser/download/notification/download_group_notification.cc |
+++ b/chrome/browser/download/notification/download_group_notification.cc |
@@ -97,10 +97,17 @@ void DownloadGroupNotification::OnDownloadAdded( |
content::DownloadItem* download) { |
if (items_.find(download) == items_.end()) { |
items_.insert(download); |
+ int inprogress_download_count = 0; |
// If new download is started and there are more than 2 downloads in total, |
// show the group notification. |
- if (items_.size() >= 2) |
- Show(); |
+ for (auto it = items_.begin(); it != items_.end(); it++) { |
asanka
2015/08/04 21:55:09
for (const auto& item : items_) {
if (!item->IsD
yoshiki
2015/08/05 09:09:31
Done.
|
+ if (!(*it)->IsDone()) { |
+ if (++inprogress_download_count >= 2) { |
+ Show(); |
+ break; |
+ } |
+ } |
+ } |
} |
} |