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

Side by Side Diff: chrome/browser/resources/md_downloads/item_view.js

Issue 1230063004: Add progress bars to MD downloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dl-rough-draft2
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/md_downloads/item_view.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('downloads', function() { 5 cr.define('downloads', function() {
6 var ItemView = Polymer({ 6 var ItemView = Polymer({
7 is: 'item-view', 7 is: 'item-view',
8 8
9 /** @param {!downloads.ThrottledIconLoader} iconLoader */ 9 /** @param {!downloads.ThrottledIconLoader} iconLoader */
10 factoryImpl: function(iconLoader) { 10 factoryImpl: function(iconLoader) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 link.setAttribute('column-type', 'controlled-by'); 109 link.setAttribute('column-type', 'controlled-by');
110 link.textContent = data.by_ext_name; 110 link.textContent = data.by_ext_name;
111 } 111 }
112 112
113 this.ensureTextIs_(this.$['src-url'], data.url); 113 this.ensureTextIs_(this.$['src-url'], data.url);
114 this.$['src-url'].href = data.url; 114 this.$['src-url'].href = data.url;
115 this.ensureTextIs_(this.$.status, this.getStatusText_(data)); 115 this.ensureTextIs_(this.$.status, this.getStatusText_(data));
116 116
117 this.$.progress.hidden = !isInProgress; 117 this.$.progress.hidden = !isInProgress;
118 118
119 // TODO(dbeam): implement progress. 119 if (isInProgress)
120 this.$.progress.value = data.percent;
120 } 121 }
121 }, 122 },
122 123
123 /** 124 /**
124 * Overwrite |el|'s textContent if it differs from |text|. 125 * Overwrite |el|'s textContent if it differs from |text|.
125 * @param {!Element} el 126 * @param {!Element} el
126 * @param {string} text 127 * @param {string} text
127 * @private 128 * @private
128 */ 129 */
129 ensureTextIs_: function(el, text) { 130 ensureTextIs_: function(el, text) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 }, 242 },
242 243
243 /** @private */ 244 /** @private */
244 onDiscardClick_: function() { 245 onDiscardClick_: function() {
245 chrome.send('discardDangerous', [this.id_]); 246 chrome.send('discardDangerous', [this.id_]);
246 }, 247 },
247 }); 248 });
248 249
249 return {ItemView: ItemView}; 250 return {ItemView: ItemView};
250 }); 251 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_downloads/item_view.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698