| 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 DeletableItemList = options.DeletableItemList; | 6 /** @const */ var DeletableItemList = options.DeletableItemList; |
| 7 /** @const */ var DeletableItem = options.DeletableItem; | 7 /** @const */ var DeletableItem = options.DeletableItem; |
| 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| 9 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 9 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
| 10 | 10 |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 } | 738 } |
| 739 }, | 739 }, |
| 740 | 740 |
| 741 /** | 741 /** |
| 742 * Handles key down events and looks for left and right arrows, then | 742 * Handles key down events and looks for left and right arrows, then |
| 743 * dispatches to the currently expanded item, if any. | 743 * dispatches to the currently expanded item, if any. |
| 744 * @param {Event} e The keydown event. | 744 * @param {Event} e The keydown event. |
| 745 * @private | 745 * @private |
| 746 */ | 746 */ |
| 747 handleKeyLeftRight_: function(e) { | 747 handleKeyLeftRight_: function(e) { |
| 748 var id = e.keyIdentifier; | 748 var id = e.key; |
| 749 if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) | 749 if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) |
| 750 return; | 750 return; |
| 751 if ((id == 'Left' || id == 'Right') && this.expandedItem) { | 751 if ((id == 'ArrowLeft' || id == 'ArrowRight') && this.expandedItem) { |
| 752 var cs = this.ownerDocument.defaultView.getComputedStyle(this); | 752 var cs = this.ownerDocument.defaultView.getComputedStyle(this); |
| 753 var rtl = cs.direction == 'rtl'; | 753 var rtl = cs.direction == 'rtl'; |
| 754 if ((!rtl && id == 'Left') || (rtl && id == 'Right')) | 754 if ((!rtl && id == 'ArrowLeft') || (rtl && id == 'ArrowRight')) |
| 755 this.expandedItem.selectedIndex--; | 755 this.expandedItem.selectedIndex--; |
| 756 else | 756 else |
| 757 this.expandedItem.selectedIndex++; | 757 this.expandedItem.selectedIndex++; |
| 758 this.scrollIndexIntoView(this.expandedItem.listIndex); | 758 this.scrollIndexIntoView(this.expandedItem.listIndex); |
| 759 // Prevent the page itself from scrolling. | 759 // Prevent the page itself from scrolling. |
| 760 e.preventDefault(); | 760 e.preventDefault(); |
| 761 } | 761 } |
| 762 }, | 762 }, |
| 763 | 763 |
| 764 /** | 764 /** |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 parent.endBatchUpdates(); | 944 parent.endBatchUpdates(); |
| 945 }, | 945 }, |
| 946 }; | 946 }; |
| 947 | 947 |
| 948 return { | 948 return { |
| 949 CookiesList: CookiesList, | 949 CookiesList: CookiesList, |
| 950 CookieListItem: CookieListItem, | 950 CookieListItem: CookieListItem, |
| 951 CookieTreeNode: CookieTreeNode, | 951 CookieTreeNode: CookieTreeNode, |
| 952 }; | 952 }; |
| 953 }); | 953 }); |
| OLD | NEW |