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

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: Addressed comment 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
« no previous file with comments | « no previous file | chrome/browser/download/notification/download_notification_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..020af24680cfd53038f265cccaabafe23f15948a 100644
--- a/chrome/browser/download/notification/download_group_notification.cc
+++ b/chrome/browser/download/notification/download_group_notification.cc
@@ -97,10 +97,15 @@ 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++) {
+ if (!(*it)->IsDone() && ++inprogress_download_count >= 2) {
+ Show();
+ break;
+ }
+ }
}
}
« no previous file with comments | « no previous file | chrome/browser/download/notification/download_notification_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698