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

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: Created 8 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 6ff24f7ae03635735cda33b567b4f505d55faf14..a222f8c1a5ce65bf814adac917c67542e2114a2b 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",
- base::Bind(&DownloadsDOMHandler::HandlePause,
+ web_ui()->RegisterMessageCallback("pause",
+ base::Bind(&DownloadsDOMHandler::Pause,
benjhayden 2013/01/02 16:19:50 Why remove the "Handle" prefix?
Randy Smith (Not in Mondays) 2013/01/02 20:16:02 Whoops; I had missed that bit of consistency. Don
weak_ptr_factory_.GetWeakPtr()));
web_ui()->RegisterMessageCallback("resume",
- base::Bind(&DownloadsDOMHandler::HandlePause,
+ base::Bind(&DownloadsDOMHandler::Resume,
weak_ptr_factory_.GetWeakPtr()));
web_ui()->RegisterMessageCallback("remove",
base::Bind(&DownloadsDOMHandler::HandleRemove,
@@ -373,11 +374,18 @@ void DownloadsDOMHandler::HandleShow(const base::ListValue* args) {
file->ShowDownloadInShell();
}
-void DownloadsDOMHandler::HandlePause(const base::ListValue* args) {
+void DownloadsDOMHandler::Pause(const base::ListValue* args) {
CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_PAUSE);
content::DownloadItem* file = GetDownloadByValue(args);
if (file)
- file->TogglePause();
+ file->Pause();
+}
+
+void DownloadsDOMHandler::Resume(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) {

Powered by Google App Engine
This is Rietveld 408576698