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

Side by Side Diff: chrome/browser/resources/options/inline_editable_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 DeletableItem = options.DeletableItem; 6 /** @const */ var DeletableItem = options.DeletableItem;
7 /** @const */ var DeletableItemList = options.DeletableItemList; 7 /** @const */ var DeletableItemList = options.DeletableItemList;
8 8
9 /** 9 /**
10 * Creates a new list item with support for inline editing. 10 * Creates a new list item with support for inline editing.
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 * Called when a key is pressed. Handles committing and canceling edits. 473 * Called when a key is pressed. Handles committing and canceling edits.
474 * @param {Event} e The key down event. 474 * @param {Event} e The key down event.
475 * @private 475 * @private
476 */ 476 */
477 handleKeyDown_: function(e) { 477 handleKeyDown_: function(e) {
478 if (!this.editing) 478 if (!this.editing)
479 return; 479 return;
480 480
481 var endEdit = false; 481 var endEdit = false;
482 var handledKey = true; 482 var handledKey = true;
483 switch (e.keyIdentifier) { 483 switch (e.key) {
484 case 'U+001B': // Esc 484 case 'Escape':
485 this.editCancelled_ = true; 485 this.editCancelled_ = true;
486 endEdit = true; 486 endEdit = true;
487 break; 487 break;
488 case 'Enter': 488 case 'Enter':
489 if (this.currentInputIsValid) 489 if (this.currentInputIsValid)
490 endEdit = true; 490 endEdit = true;
491 break; 491 break;
492 default: 492 default:
493 handledKey = false; 493 handledKey = false;
494 } 494 }
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 this.getListItemByIndex(0)); 765 this.getListItemByIndex(0));
766 }, 766 },
767 }; 767 };
768 768
769 // Export 769 // Export
770 return { 770 return {
771 InlineEditableItem: InlineEditableItem, 771 InlineEditableItem: InlineEditableItem,
772 InlineEditableItemList: InlineEditableItemList, 772 InlineEditableItemList: InlineEditableItemList,
773 }; 773 };
774 }); 774 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/home_page_overlay.js ('k') | chrome/browser/resources/options/language_dictionary_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698