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

Unified Diff: chrome/browser/resources/options/deletable_item_list.js

Issue 664583006: Improve keyboard navigation on 'Manage search engines' options page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/options/deletable_item_list.js
diff --git a/chrome/browser/resources/options/deletable_item_list.js b/chrome/browser/resources/options/deletable_item_list.js
index 0d52ff07bab0d275472f3c7a551460cf0caee9d6..3ab974bea264d11e77ac59907842e1ccbb875874 100644
--- a/chrome/browser/resources/options/deletable_item_list.js
+++ b/chrome/browser/resources/options/deletable_item_list.js
@@ -38,6 +38,13 @@ cr.define('options', function() {
*/
deletable_: true,
+ /**
+ * Whether or not the close button can be navigated to using the keyboard.
+ * @type {boolean}
+ * @private
+ */
+ closeButtonFocusable_: false,
+
/** @override */
decorate: function() {
ListItem.prototype.decorate.call(this);
@@ -58,7 +65,7 @@ cr.define('options', function() {
this.handleMouseDownUpOnClose_);
this.closeButtonElement_.addEventListener('focus',
this.handleFocus_.bind(this));
- this.closeButtonElement_.tabIndex = -1;
+ this.closeButtonFocusable = false;
this.closeButtonElement_.title =
loadTimeData.getString('deletableItemDeleteButtonTitle');
this.appendChild(this.closeButtonElement_);
@@ -91,6 +98,18 @@ cr.define('options', function() {
this.closeButtonElement_.disabled = !value;
},
+ /* Gets/sets the closeButtonFocusable property. If closeButtonFocusable is
+ * false then the delete button does not participate in the keyboard tab
+ * order.
+ */
+ get closeButtonFocusable() {
+ return this.closeButtonFocusable_;
+ },
+ set closeButtonFocusable(value) {
Dan Beam 2014/10/18 01:35:43 nit: if (focusable != this.closeButtonFocusable
Dan Beam 2014/10/18 01:35:43 nit: value => focusable
+ this.closeButtonElement_.tabIndex = value ? 0 : -1;
+ this.closeButtonFocusable_ = value;
+ },
+
/**
* Called when a focusable child element receives focus. Selects this item
* in the list selection model.

Powered by Google App Engine
This is Rietveld 408576698