OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('options', function() { | 5 cr.define('options', function() { |
6 /** @const */ var List = cr.ui.List; | 6 /** @const */ var List = cr.ui.List; |
7 /** @const */ var ListItem = cr.ui.ListItem; | 7 /** @const */ var ListItem = cr.ui.ListItem; |
8 | 8 |
9 /** | 9 /** |
10 * Creates a deletable list item, which has a button that will trigger a call | 10 * Creates a deletable list item, which has a button that will trigger a call |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 this.closeButtonElement_ = this.ownerDocument.createElement('button'); | 48 this.closeButtonElement_ = this.ownerDocument.createElement('button'); |
49 this.closeButtonElement_.className = | 49 this.closeButtonElement_.className = |
50 'raw-button row-delete-button custom-appearance'; | 50 'raw-button row-delete-button custom-appearance'; |
51 this.closeButtonElement_.addEventListener('mousedown', | 51 this.closeButtonElement_.addEventListener('mousedown', |
52 this.handleMouseDownUpOnClose_); | 52 this.handleMouseDownUpOnClose_); |
53 this.closeButtonElement_.addEventListener('mouseup', | 53 this.closeButtonElement_.addEventListener('mouseup', |
54 this.handleMouseDownUpOnClose_); | 54 this.handleMouseDownUpOnClose_); |
55 this.closeButtonElement_.addEventListener('focus', | 55 this.closeButtonElement_.addEventListener('focus', |
56 this.handleFocus_.bind(this)); | 56 this.handleFocus_.bind(this)); |
| 57 this.closeButtonElement_.tabIndex = -1; |
57 this.closeButtonElement_.title = | 58 this.closeButtonElement_.title = |
58 loadTimeData.getString('deletableItemDeleteButtonTitle'); | 59 loadTimeData.getString('deletableItemDeleteButtonTitle'); |
59 this.appendChild(this.closeButtonElement_); | 60 this.appendChild(this.closeButtonElement_); |
60 }, | 61 }, |
61 | 62 |
62 /** | 63 /** |
63 * Returns the element subclasses should add content to. | 64 * Returns the element subclasses should add content to. |
64 * @return {HTMLElement} The element subclasses should popuplate. | 65 * @return {HTMLElement} The element subclasses should popuplate. |
65 */ | 66 */ |
66 get contentElement() { | 67 get contentElement() { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 */ | 188 */ |
188 deleteItemAtIndex: function(index) { | 189 deleteItemAtIndex: function(index) { |
189 }, | 190 }, |
190 }; | 191 }; |
191 | 192 |
192 return { | 193 return { |
193 DeletableItemList: DeletableItemList, | 194 DeletableItemList: DeletableItemList, |
194 DeletableItem: DeletableItem, | 195 DeletableItem: DeletableItem, |
195 }; | 196 }; |
196 }); | 197 }); |
OLD | NEW |