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

Side by Side Diff: chrome/browser/resources/ntp4/page_list_view.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
« no previous file with comments | « chrome/browser/resources/ntp4/nav_dot.js ('k') | chrome/browser/resources/ntp4/tile_page.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * @fileoverview PageListView implementation. 6 * @fileoverview PageListView implementation.
7 * PageListView manages page list, dot list, switcher buttons and handles apps 7 * PageListView manages page list, dot list, switcher buttons and handles apps
8 * pages callbacks from backend. 8 * pages callbacks from backend.
9 * 9 *
10 * Note that you need to have AppLauncherHandler in your WebUI to use this code. 10 * Note that you need to have AppLauncherHandler in your WebUI to use this code.
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 * Handler for key events on the page. Ctrl-Arrow will switch the visible 725 * Handler for key events on the page. Ctrl-Arrow will switch the visible
726 * page. 726 * page.
727 * @param {Event} e The KeyboardEvent. 727 * @param {Event} e The KeyboardEvent.
728 * @private 728 * @private
729 */ 729 */
730 onDocKeyDown_: function(e) { 730 onDocKeyDown_: function(e) {
731 if (!e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) 731 if (!e.ctrlKey || e.altKey || e.metaKey || e.shiftKey)
732 return; 732 return;
733 733
734 var direction = 0; 734 var direction = 0;
735 if (e.keyIdentifier == 'Left') 735 if (e.key == 'ArrowLeft')
736 direction = -1; 736 direction = -1;
737 else if (e.keyIdentifier == 'Right') 737 else if (e.key == 'ArrowRight')
738 direction = 1; 738 direction = 1;
739 else 739 else
740 return; 740 return;
741 741
742 var cardIndex = 742 var cardIndex =
743 (this.cardSlider.currentCard + direction + 743 (this.cardSlider.currentCard + direction +
744 this.cardSlider.cardCount) % this.cardSlider.cardCount; 744 this.cardSlider.cardCount) % this.cardSlider.cardCount;
745 this.cardSlider.selectCard(cardIndex, true); 745 this.cardSlider.selectCard(cardIndex, true);
746 746
747 e.stopPropagation(); 747 e.stopPropagation();
(...skipping 18 matching lines...) Expand all
766 if (page.navigationDot) 766 if (page.navigationDot)
767 page.navigationDot.remove(opt_animate); 767 page.navigationDot.remove(opt_animate);
768 this.cardSlider.removeCard(page); 768 this.cardSlider.removeCard(page);
769 }, 769 },
770 }; 770 };
771 771
772 return { 772 return {
773 PageListView: PageListView 773 PageListView: PageListView
774 }; 774 };
775 }); 775 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/nav_dot.js ('k') | chrome/browser/resources/ntp4/tile_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698