| Index: chrome/browser/resources/md_downloads/item.js
|
| diff --git a/chrome/browser/resources/md_downloads/item.js b/chrome/browser/resources/md_downloads/item.js
|
| index 038623c8fedffaf1f76a860c95c20aeb24105f8f..7087a50079559028b58aac4564084752ea62a835 100644
|
| --- a/chrome/browser/resources/md_downloads/item.js
|
| +++ b/chrome/browser/resources/md_downloads/item.js
|
| @@ -37,12 +37,23 @@ cr.define('downloads', function() {
|
| value: false,
|
| },
|
|
|
| + isMalware_: {
|
| + computed: 'computeIsMalware_(isDangerous_, data.danger_type)',
|
| + type: Boolean,
|
| + value: false,
|
| + },
|
| +
|
| isInProgress_: {
|
| computed: 'computeIsInProgress_(data.state)',
|
| type: Boolean,
|
| value: false,
|
| },
|
|
|
| + pauseOrResumeText_: {
|
| + computed: 'computePauseOrResumeText_(isInProgress_, data.resume)',
|
| + type: String,
|
| + },
|
| +
|
| showCancel_: {
|
| computed: 'computeShowCancel_(data.state)',
|
| type: Boolean,
|
| @@ -54,12 +65,6 @@ cr.define('downloads', function() {
|
| type: Boolean,
|
| value: false,
|
| },
|
| -
|
| - isMalware_: {
|
| - computed: 'computeIsMalware_(isDangerous_, data.danger_type)',
|
| - type: Boolean,
|
| - value: false,
|
| - },
|
| },
|
|
|
| observers: [
|
| @@ -187,6 +192,15 @@ cr.define('downloads', function() {
|
| },
|
|
|
| /** @private */
|
| + computePauseOrResumeText_: function() {
|
| + if (this.isInProgress_)
|
| + return loadTimeData.getString('controlPause');
|
| + if (this.data.resume)
|
| + return loadTimeData.getString('controlResume');
|
| + return '';
|
| + },
|
| +
|
| + /** @private */
|
| computeRemoveStyle_: function() {
|
| var canDelete = loadTimeData.getBoolean('allowDeletingHistory');
|
| var hideRemove = this.isDangerous_ || this.showCancel_ || !canDelete;
|
| @@ -275,8 +289,11 @@ cr.define('downloads', function() {
|
| },
|
|
|
| /** @private */
|
| - onPauseTap_: function() {
|
| - downloads.ActionService.getInstance().pause(this.data.id);
|
| + onPauseOrResumeTap_: function() {
|
| + if (this.isInProgress_)
|
| + downloads.ActionService.getInstance().pause(this.data.id);
|
| + else
|
| + downloads.ActionService.getInstance().resume(this.data.id);
|
| },
|
|
|
| /** @private */
|
| @@ -285,11 +302,6 @@ cr.define('downloads', function() {
|
| },
|
|
|
| /** @private */
|
| - onResumeTap_: function() {
|
| - downloads.ActionService.getInstance().resume(this.data.id);
|
| - },
|
| -
|
| - /** @private */
|
| onRetryTap_: function() {
|
| downloads.ActionService.getInstance().download(this.data.url);
|
| },
|
|
|