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

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

Issue 1313453002: Make cr.ui.Focus* play nice with Shadow DOM and MD chrome://downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 4 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/md_downloads/focus_row.js
diff --git a/chrome/browser/resources/md_downloads/focus_row.js b/chrome/browser/resources/md_downloads/focus_row.js
new file mode 100644
index 0000000000000000000000000000000000000000..deb592e3f48ba787e49e3694c78f3b402af0e6e2
--- /dev/null
+++ b/chrome/browser/resources/md_downloads/focus_row.js
@@ -0,0 +1,35 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('downloads', function() {
+ /**
+ * @param {!Element} root
+ * @param {?Node} boundary
+ * @constructor
+ * @extends {cr.ui.FocusRow}
+ */
+ function FocusRow(root, boundary) {
+ cr.ui.FocusRow.call(this, root, boundary);
+
+ this.addItem('name-file-link',
+ '#content.is-active:not(.show-progress) #name');
+ assert(this.addItem('name-file-link', '#file-link'));
+ assert(this.addItem('url', '#url'));
+ assert(this.addItem('show-retry', '#show'));
+ assert(this.addItem('show-retry', '#retry'));
+ assert(this.addItem('pause-resume', '#pause'));
+ assert(this.addItem('pause-resume', '#resume'));
+ assert(this.addItem('cancel', '#cancel'));
+ this.addItem('controlled-by', '#controlled-by a');
hcarmona 2015/08/24 21:00:37 Why no assert for this?
Dan Beam 2015/08/24 22:59:30 it's not guaranteed to exist
hcarmona 2015/08/24 23:49:19 Acknowledged.
+ assert(this.addItem('danger-remove-discard', '#discard'));
+ assert(this.addItem('restore-save', '#save'));
+ assert(this.addItem('danger-remove-discard', '#danger-remove'));
+ assert(this.addItem('restore-save', '#restore'));
+ assert(this.addItem('remove', '#remove'));
+ }
+
+ FocusRow.prototype = {__proto__: cr.ui.FocusRow.prototype};
+
+ return {FocusRow: FocusRow};
+});

Powered by Google App Engine
This is Rietveld 408576698