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

Unified Diff: chrome/browser/ui/webui/downloads_dom_handler.cc

Issue 795353002: downloads: prevent "Clear all" from removing in progress downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo Created 6 years 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/ui/webui/downloads_dom_handler.cc
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index 5ab35f113d923063dcddd69aa4d7f34c611bbe1d..0a990713c77d06cff304f3c906e164ece738101b 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -543,8 +543,10 @@ void DownloadsDOMHandler::RemoveDownloads(
const std::vector<content::DownloadItem*>& to_remove) {
std::set<uint32> ids;
for (auto* download : to_remove) {
- if (IsRemoved(*download))
+ if (IsRemoved(*download) ||
+ download->GetState() == content::DownloadItem::IN_PROGRESS) {
continue;
+ }
DownloadsDOMHandlerData::Create(download)->set_is_removed(true);
ids.insert(download->GetId());

Powered by Google App Engine
This is Rietveld 408576698