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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js

Issue 2033403005: Eradicate keyIndentifier from devtools/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call KeyCodeToKeyIdentifier for unhandle key events 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
index 787b1098d8e0df9d9a9f46ad84de635aeaa8af0a..59e0d561ce5e4eb3d653837f2c8687f01cc1f217 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
@@ -309,28 +309,28 @@ WebInspector.TextPrompt.prototype = {
var handled = false;
delete this._needUpdateAutocomplete;
- switch (event.keyIdentifier) {
- case "U+0009": // Tab
+ switch (event.key) {
+ case "Tab":
handled = this.tabKeyPressed(event);
break;
- case "Left":
+ case "ArrowLeft":
case "Home":
this._removeSuggestionAids();
break;
- case "Right":
+ case "ArrowRight":
case "End":
if (this.isCaretAtEndOfPrompt())
handled = this.acceptAutoComplete();
else
this._removeSuggestionAids();
break;
- case "U+001B": // Esc
+ case "Escape":
if (this.isSuggestBoxVisible()) {
this._removeSuggestionAids();
handled = true;
}
break;
- case "U+0020": // Space
+ case " ": // Space
if (event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {
this._updateAutoComplete(true);
handled = true;
@@ -965,25 +965,27 @@ WebInspector.TextPromptWithHistory.prototype = {
var newText;
var isPrevious;
- switch (event.keyIdentifier) {
- case "Up":
+ switch (event.key) {
+ case "ArrowUp":
if (!this.isCaretOnFirstLine() || this.isSuggestBoxVisible())
break;
newText = this._previous();
isPrevious = true;
break;
- case "Down":
+ case "ArrowDown":
if (!this.isCaretOnLastLine() || this.isSuggestBoxVisible())
break;
newText = this._next();
break;
- case "U+0050": // Ctrl+P = Previous
+ case "P": // Ctrl+P = Previous
+ case "p":
if (WebInspector.isMac() && event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {
newText = this._previous();
isPrevious = true;
}
break;
- case "U+004E": // Ctrl+N = Next
+ case "N": // Ctrl+N = Next
+ case "n":
if (WebInspector.isMac() && event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey)
newText = this._next();
break;

Powered by Google App Engine
This is Rietveld 408576698