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

Unified Diff: chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h

Issue 2100443003: MD Downloads: "Clear All" should remove dangerous downloads for good (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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/ui/webui/md_downloads/md_downloads_dom_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h
diff --git a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h
index 10636211a55848c30b035f9ea252bd0b14175a4b..029854b1a75918b7d9e51c7f64f12f2b1b4d8a64 100644
--- a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h
+++ b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h
@@ -96,9 +96,14 @@ class MdDownloadsDOMHandler : public content::WebContentsObserver,
// Actually remove downloads with an ID in |removals_|. This cannot be undone.
void FinalizeRemovals();
+ using DownloadVector = std::vector<content::DownloadItem*>;
+
+ // Remove all downloads in |to_remove|. Safe downloads can be revived,
+ // dangerous ones are immediately removed. Protected for testing.
+ void RemoveDownloads(const DownloadVector& to_remove);
+
private:
using IdSet = std::set<uint32_t>;
- using DownloadVector = std::vector<content::DownloadItem*>;
// Convenience method to call |main_notifier_->GetManager()| while
// null-checking |main_notifier_|.
@@ -130,8 +135,8 @@ class MdDownloadsDOMHandler : public content::WebContentsObserver,
// Returns the download with |id| or NULL if it doesn't exist.
content::DownloadItem* GetDownloadById(uint32_t id);
- // Remove all downloads in |to_remove| with the ability to undo removal later.
- void RemoveDownloads(const DownloadVector& to_remove);
+ // Removes the download specified by an ID from JavaScript in |args|.
+ void RemoveDownloadInArgs(const base::ListValue* args);
// Checks whether a download's file was removed from its original location.
void CheckForRemovedFiles();
« no previous file with comments | « no previous file | chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698