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

Unified Diff: chrome/browser/resources/md_downloads/crisper.js

Issue 2154033002: MD Downloads: fix focus issue on downloads page by combining pause/play (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge + re-vulcanize Created 4 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 | « no previous file | chrome/browser/resources/md_downloads/item.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_downloads/crisper.js
diff --git a/chrome/browser/resources/md_downloads/crisper.js b/chrome/browser/resources/md_downloads/crisper.js
index 511053bb2cb5b1c277628bf93791729b4b7837e1..270d4d29eb2c4ea2f9e86da47b0cb380cadc938d 100644
--- a/chrome/browser/resources/md_downloads/crisper.js
+++ b/chrome/browser/resources/md_downloads/crisper.js
@@ -6322,12 +6322,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,
@@ -6339,12 +6350,6 @@ cr.define('downloads', function() {
type: Boolean,
value: false,
},
-
- isMalware_: {
- computed: 'computeIsMalware_(isDangerous_, data.danger_type)',
- type: Boolean,
- value: false,
- },
},
observers: [
@@ -6472,6 +6477,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;
@@ -6560,8 +6574,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 */
@@ -6570,11 +6587,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);
},
@@ -11377,7 +11389,7 @@ cr.define('downloads', function() {
},
/** @private */
- closeMoreActions_: function(e) {
+ closeMoreActions_: function() {
this.$.more.close();
},
@@ -11402,7 +11414,8 @@ cr.define('downloads', function() {
* @private
*/
onItemBlur_: function(e) {
- if (this.$$('paper-menu').items.indexOf(e.relatedTarget) >= 0)
+ var menu = /** @type {PaperMenuElement} */(this.$$('paper-menu'));
+ if (menu.items.indexOf(e.relatedTarget) >= 0)
Dan Beam 2016/07/19 01:41:21 totallllly remembered to re-vulcanize after that l
return;
// This can be this.$.more.restoreFocusOnClose = false when this lands:
« no previous file with comments | « no previous file | chrome/browser/resources/md_downloads/item.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698