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

Side by Side Diff: chrome/browser/resources/options/cookies_list.js

Issue 2059913002: Remove keyIdentifier usage in chrome/browser/resources/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chromeos build Created 4 years, 6 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 unified diff | Download patch
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/chromeos/network_list.js ('k') | chrome/browser/resources/options/cookies_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698