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

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

Issue 722953002: downloads: add the ability to undo download removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes 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
« no previous file with comments | « chrome/browser/resources/downloads/downloads.js ('k') | chrome/browser/ui/webui/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/downloads_dom_handler.h
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.h b/chrome/browser/ui/webui/downloads_dom_handler.h
index 30c42e387b37da8ced1c1b5c89791ee5f2586693..2027b2d0c7a0150cba7b88abde74fe06bcb3e9d1 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.h
+++ b/chrome/browser/ui/webui/downloads_dom_handler.h
@@ -78,6 +78,9 @@ class DownloadsDOMHandler : public content::WebUIMessageHandler,
// and list.
void HandleRemove(const base::ListValue* args);
+ // Callback for the "undo" message. Currently only undoes removals.
+ void HandleUndo(const base::ListValue* args);
+
// Callback for the "cancel" message - cancels the download.
void HandleCancel(const base::ListValue* args);
@@ -127,6 +130,9 @@ class DownloadsDOMHandler : public content::WebUIMessageHandler,
// Returns the download that is referred to in a given value.
content::DownloadItem* GetDownloadByValue(const base::ListValue* args);
+ // Returns the download with |id| or NULL if it doesn't exist.
+ content::DownloadItem* GetDownloadById(uint32 id);
+
// Current search terms.
scoped_ptr<base::ListValue> search_terms_;
@@ -137,6 +143,9 @@ class DownloadsDOMHandler : public content::WebUIMessageHandler,
// DownloadManager for the original profile; otherwise, this is NULL.
scoped_ptr<AllDownloadItemNotifier> original_notifier_;
+ // IDs of downloads to remove when this handler gets deleted.
+ std::vector<uint32> removed_ids_;
+
// Whether a call to SendCurrentDownloads() is currently scheduled.
bool update_scheduled_;
« no previous file with comments | « chrome/browser/resources/downloads/downloads.js ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698