Chromium Code Reviews| 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. |