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

Unified Diff: chrome/browser/download/notification/download_group_notification.cc

Issue 1271693006: Don't show the group notification when there is only one in-progress download (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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: 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;
+ }
+ }
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698