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

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

Issue 11711003: Remove the DownloadItem::TogglePause() interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r175145. Created 7 years, 12 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/ui/webui/downloads_dom_handler.h ('k') | chrome/test/functional/downloads.py » ('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.cc
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index 6ff24f7ae03635735cda33b567b4f505d55faf14..ed02c6ac60aaf9900cfb3044412fa19e820ec23e 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -73,6 +73,7 @@ enum DownloadsDOMEvent {
DOWNLOADS_DOM_EVENT_CANCEL = 8,
DOWNLOADS_DOM_EVENT_CLEAR_ALL = 9,
DOWNLOADS_DOM_EVENT_OPEN_FOLDER = 10,
+ DOWNLOADS_DOM_EVENT_RESUME = 11,
DOWNLOADS_DOM_EVENT_MAX
};
@@ -253,11 +254,11 @@ void DownloadsDOMHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("show",
base::Bind(&DownloadsDOMHandler::HandleShow,
weak_ptr_factory_.GetWeakPtr()));
- web_ui()->RegisterMessageCallback("togglepause",
+ web_ui()->RegisterMessageCallback("pause",
base::Bind(&DownloadsDOMHandler::HandlePause,
weak_ptr_factory_.GetWeakPtr()));
web_ui()->RegisterMessageCallback("resume",
- base::Bind(&DownloadsDOMHandler::HandlePause,
+ base::Bind(&DownloadsDOMHandler::HandleResume,
weak_ptr_factory_.GetWeakPtr()));
web_ui()->RegisterMessageCallback("remove",
base::Bind(&DownloadsDOMHandler::HandleRemove,
@@ -377,7 +378,14 @@ void DownloadsDOMHandler::HandlePause(const base::ListValue* args) {
CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_PAUSE);
content::DownloadItem* file = GetDownloadByValue(args);
if (file)
- file->TogglePause();
+ file->Pause();
+}
+
+void DownloadsDOMHandler::HandleResume(const base::ListValue* args) {
+ CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_RESUME);
+ content::DownloadItem* file = GetDownloadByValue(args);
+ if (file)
+ file->Resume();
}
void DownloadsDOMHandler::HandleRemove(const base::ListValue* args) {
« no previous file with comments | « chrome/browser/ui/webui/downloads_dom_handler.h ('k') | chrome/test/functional/downloads.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698