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

Unified Diff: chrome/browser/resources/pdf/pdf_scripting_api.js

Issue 2358553002: PDF: Use KeyboardEvent.code instead of keyCode.
Patch Set: Created 4 years, 3 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
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/pdf/pdf_scripting_api.js
diff --git a/chrome/browser/resources/pdf/pdf_scripting_api.js b/chrome/browser/resources/pdf/pdf_scripting_api.js
index 712e390207e2cb443611cab2cfcf26eddbfb633b..259b195d6c725dc1a072bb80494d4e57c97636ac 100644
--- a/chrome/browser/resources/pdf/pdf_scripting_api.js
+++ b/chrome/browser/resources/pdf/pdf_scripting_api.js
@@ -10,7 +10,10 @@
function DeserializeKeyEvent(dict) {
var e = document.createEvent('Event');
e.initEvent('keydown');
+ // TODO(thestig): Remove this once setKeyEventCallback() callers have been
+ // converted to event.code. Ditto below in SerializeKeyEvent().
e.keyCode = dict.keyCode;
+ e.code = dict.code;
e.shiftKey = dict.shiftKey;
e.ctrlKey = dict.ctrlKey;
e.altKey = dict.altKey;
@@ -27,6 +30,7 @@ function DeserializeKeyEvent(dict) {
function SerializeKeyEvent(event) {
return {
keyCode: event.keyCode,
+ code: event.code,
shiftKey: event.shiftKey,
ctrlKey: event.ctrlKey,
altKey: event.altKey,
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698