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

Unified Diff: chrome/browser/resources/downloads/downloads.js

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
Index: chrome/browser/resources/downloads/downloads.js
diff --git a/chrome/browser/resources/downloads/downloads.js b/chrome/browser/resources/downloads/downloads.js
index e5f23f10d6ae66cf0ef1a4535b508582fac276f2..26bf50b2b8ab0bfee5b9eec25646d4d749dad0bc 100644
--- a/chrome/browser/resources/downloads/downloads.js
+++ b/chrome/browser/resources/downloads/downloads.js
@@ -310,11 +310,11 @@ function Download(download) {
this.nodeControls_.appendChild(this.controlRetry_);
// Pause/Resume are a toggle.
- this.controlPause_ = createLink(this.togglePause_.bind(this),
+ this.controlPause_ = createLink(this.pause_.bind(this),
loadTimeData.getString('control_pause'));
this.nodeControls_.appendChild(this.controlPause_);
- this.controlResume_ = createLink(this.togglePause_.bind(this),
+ this.controlResume_ = createLink(this.resume_.bind(this),
loadTimeData.getString('control_resume'));
this.nodeControls_.appendChild(this.controlResume_);
@@ -611,8 +611,18 @@ Download.prototype.show_ = function() {
* @return {boolean} Returns false to prevent the default action.
* @private
*/
-Download.prototype.togglePause_ = function() {
- chrome.send('togglepause', [this.id_.toString()]);
+Download.prototype.pause_ = function() {
+ chrome.send('pause', [this.id_.toString()]);
+ return false;
+};
+
+/**
+ * Tells the backend to resume this download.
+ * @return {boolean} Returns false to prevent the default action.
+ * @private
+ */
+Download.prototype.resume_ = function() {
+ chrome.send('resume', [this.id_.toString()]);
return false;
};
« no previous file with comments | « chrome/browser/extensions/api/downloads/downloads_api.cc ('k') | chrome/browser/ui/webui/downloads_dom_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698