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

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

Issue 2738063008: WebUI: Polymer config tweaks for better performance. (Closed)
Patch Set: Rebase + comment. Created 3 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 cr.define('downloads', function() {
6 /**
7 * @param {!Element} root
8 * @param {?Node} boundary
9 * @constructor
10 * @extends {cr.ui.FocusRow}
11 */
12 function FocusRow(root, boundary) {
13 cr.ui.FocusRow.call(this, root, boundary);
14 this.addItems();
15 }
16
17 FocusRow.prototype = {
18 __proto__: cr.ui.FocusRow.prototype,
19
20 addItems: function() {
21 this.destroy();
22
23 this.addItem('name-file-link',
24 'content.is-active:not(.show-progress):not(.dangerous) #name');
25 assert(this.addItem('name-file-link', '#file-link'));
26 assert(this.addItem('url', '#url'));
27 this.addItem('show-retry', '#show');
28 this.addItem('show-retry', '#retry');
29 this.addItem('pause-resume', '#pause');
30 this.addItem('pause-resume', '#resume');
31 this.addItem('cancel', '#cancel');
32 this.addItem('controlled-by', '#controlled-by a');
33 this.addItem('danger-remove-discard', '#discard');
34 this.addItem('restore-save', '#save');
35 this.addItem('danger-remove-discard', '#danger-remove');
36 this.addItem('restore-save', '#restore');
37 assert(this.addItem('remove', '#remove'));
38
39 // TODO(dbeam): it would be nice to do this asynchronously (so if multiple
40 // templates get rendered we only re-add once), but Manager#updateItem_()
41 // relies on the DOM being re-rendered synchronously.
42 this.eventTracker.add(this.root, 'dom-change', this.addItems.bind(this));
43 },
44 };
45
46 return {FocusRow: FocusRow};
47 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698