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

Side by Side Diff: chrome/browser/resources/bookmark_manager/js/bmm/bookmark_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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/i_search.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 // TODO(arv): Now that this is driven by a data model, implement a data model 5 // TODO(arv): Now that this is driven by a data model, implement a data model
6 // that handles the loading and the events from the bookmark backend. 6 // that handles the loading and the events from the bookmark backend.
7 7
8 /** 8 /**
9 * @typedef {{childIds: Array<string>}} 9 * @typedef {{childIds: Array<string>}}
10 * 10 *
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 var urlEl = labelEl.nextSibling; 472 var urlEl = labelEl.nextSibling;
473 var labelInput, urlInput; 473 var labelInput, urlInput;
474 474
475 // Handles enter and escape which trigger reset and commit respectively. 475 // Handles enter and escape which trigger reset and commit respectively.
476 function handleKeydown(e) { 476 function handleKeydown(e) {
477 // Make sure that the tree does not handle the key. 477 // Make sure that the tree does not handle the key.
478 e.stopPropagation(); 478 e.stopPropagation();
479 479
480 // Calling list.focus blurs the input which will stop editing the list 480 // Calling list.focus blurs the input which will stop editing the list
481 // item. 481 // item.
482 switch (e.keyIdentifier) { 482 switch (e.key) {
483 case 'U+001B': // Esc 483 case 'Escape': // Esc
484 labelInput.value = title; 484 labelInput.value = title;
485 if (!isFolder) 485 if (!isFolder)
486 urlInput.value = url; 486 urlInput.value = url;
487 // fall through 487 // fall through
488 cr.dispatchSimpleEvent(listItem, 'canceledit', true); 488 cr.dispatchSimpleEvent(listItem, 'canceledit', true);
489 case 'Enter': 489 case 'Enter':
490 if (listItem.parentNode) 490 if (listItem.parentNode)
491 listItem.parentNode.focus(); 491 listItem.parentNode.focus();
492 break; 492 break;
493 case 'U+0009': // Tab 493 case 'Tab': // Tab
494 // urlInput is the last focusable element in the page. If we 494 // urlInput is the last focusable element in the page. If we
495 // allowed Tab focus navigation and the page loses focus, we 495 // allowed Tab focus navigation and the page loses focus, we
496 // couldn't give focus on urlInput programatically. So, we prevent 496 // couldn't give focus on urlInput programatically. So, we prevent
497 // Tab focus navigation. 497 // Tab focus navigation.
498 if (document.activeElement == urlInput && !e.ctrlKey && 498 if (document.activeElement == urlInput && !e.ctrlKey &&
499 !e.metaKey && !e.shiftKey && !getValidURL(urlInput)) { 499 !e.metaKey && !e.shiftKey && !getValidURL(urlInput)) {
500 e.preventDefault(); 500 e.preventDefault();
501 urlInput.blur(); 501 urlInput.blur();
502 } 502 }
503 break; 503 break;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 629 }
630 } 630 }
631 } 631 }
632 }; 632 };
633 633
634 return { 634 return {
635 BookmarkList: BookmarkList, 635 BookmarkList: BookmarkList,
636 list: /** @type {Element} */(null), // Set when decorated. 636 list: /** @type {Element} */(null), // Set when decorated.
637 }; 637 };
638 }); 638 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/i_search.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698