Chromium Code Reviews| Index: chrome/browser/resources/options/inline_editable_list.js |
| diff --git a/chrome/browser/resources/options/inline_editable_list.js b/chrome/browser/resources/options/inline_editable_list.js |
| index 204ada7ac344e4ba21f35dd8ed18b162530b5192..8f87c8301f4623cb178aacea66e17551542eb5f4 100644 |
| --- a/chrome/browser/resources/options/inline_editable_list.js |
| +++ b/chrome/browser/resources/options/inline_editable_list.js |
| @@ -651,12 +651,12 @@ cr.define('options', function() { |
| onSetDataModelComplete: function() { |
| DeletableItemList.prototype.onSetDataModelComplete.call(this); |
| - var firstItem = this.getListItemByIndex(0); |
| - if (firstItem) { |
| - firstItem.setStaticValuesFocusable(true); |
| - firstItem.setCloseButtonFocusable(true); |
| - if (firstItem.isPlaceholder) |
| - firstItem.setEditableValuesFocusable(true); |
| + var item = this.getInitialFocusableItem(); |
| + if (item) { |
| + item.setStaticValuesFocusable(true); |
| + item.setCloseButtonFocusable(true); |
| + if (item.isPlaceholder) |
| + item.setEditableValuesFocusable(true); |
| } |
| }, |
| @@ -668,6 +668,15 @@ cr.define('options', function() { |
| shouldFocusPlaceholder: function() { |
| return true; |
| }, |
| + |
| + /** |
| + * Override to change which item is initially focusable. |
| + * @return {options.InlineEditableItem} Initially focusable item or null. |
| + * @protected |
| + */ |
| + getInitialFocusableItem: function() { |
|
bondd
2014/12/02 20:35:02
I made this a regular method instead of an ECMA 5
Dan Beam
2014/12/03 01:40:33
Acknowledged.
|
| + return this.getListItemByIndex(0); |
| + }, |
| }; |
| // Export |