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

Unified Diff: chrome/browser/dom_ui/downloads_dom_handler.cc

Issue 155750: Add "Remove from list" for each download in domui page.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « chrome/browser/dom_ui/downloads_dom_handler.h ('k') | chrome/browser/dom_ui/downloads_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/downloads_dom_handler.cc
===================================================================
--- chrome/browser/dom_ui/downloads_dom_handler.cc (revision 22137)
+++ chrome/browser/dom_ui/downloads_dom_handler.cc (working copy)
@@ -87,6 +87,8 @@
NewCallback(this, &DownloadsDOMHandler::HandlePause));
dom_ui_->RegisterMessageCallback("resume",
NewCallback(this, &DownloadsDOMHandler::HandlePause));
+ dom_ui_->RegisterMessageCallback("remove",
+ NewCallback(this, &DownloadsDOMHandler::HandleRemove));
dom_ui_->RegisterMessageCallback("cancel",
NewCallback(this, &DownloadsDOMHandler::HandleCancel));
dom_ui_->RegisterMessageCallback("clearAll",
@@ -195,6 +197,12 @@
file->TogglePause();
}
+void DownloadsDOMHandler::HandleRemove(const Value* value) {
+ DownloadItem* file = GetDownloadByValue(value);
+ if (file)
+ file->Remove(false);
+}
+
void DownloadsDOMHandler::HandleCancel(const Value* value) {
DownloadItem* file = GetDownloadByValue(value);
if (file)
« no previous file with comments | « chrome/browser/dom_ui/downloads_dom_handler.h ('k') | chrome/browser/dom_ui/downloads_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698