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

Unified Diff: remoting/tools/javascript_key_tester/chord_tracker.js

Issue 910483002: Remove JS summary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer feedback. Created 5 years, 10 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: remoting/tools/javascript_key_tester/chord_tracker.js
diff --git a/remoting/tools/javascript_key_tester/chord_tracker.js b/remoting/tools/javascript_key_tester/chord_tracker.js
index ca1cdb48ce0fce8f8a8b9a5b88f1a4e179d06be6..9afc26af1ff4780ab81cfe52d4883700594bb724 100644
--- a/remoting/tools/javascript_key_tester/chord_tracker.js
+++ b/remoting/tools/javascript_key_tester/chord_tracker.js
@@ -17,30 +17,26 @@ var ChordTracker = function(parentDiv) {
};
/**
- * @param {number|string} keyId Either a Javascript key-code, or a PNaCl "code"
- * string.
+ * @param {string} code The PNaCl "code" string.
* @param {string} title
* @return {void}
*/
-ChordTracker.prototype.addKeyUpEvent = function(keyId, title) {
- var text = this.keyName_(keyId);
- var span = this.addSpanElement_('key-up', text, title);
- delete this.pressedKeys_[keyId];
+ChordTracker.prototype.addKeyUpEvent = function(code, title) {
+ var span = this.addSpanElement_('key-up', code, title);
+ delete this.pressedKeys_[code];
if (!this.keysPressed_()) {
this.end_();
}
};
/**
- * @param {number|string} keyId Either a Javascript key-code, or a PNaCl "code"
- * string.
+ * @param {string} code The PNaCl "code" string.
* @param {string} title
* @return {void}
*/
-ChordTracker.prototype.addKeyDownEvent = function(keyId, title) {
- var text = this.keyName_(keyId);
- var span = this.addSpanElement_('key-down', text, title);
- this.pressedKeys_[keyId] = span;
+ChordTracker.prototype.addKeyDownEvent = function(code, title) {
+ var span = this.addSpanElement_('key-down', code, title);
+ this.pressedKeys_[code] = span;
};
/**
@@ -118,20 +114,3 @@ ChordTracker.prototype.keysPressed_ = function() {
}
return false;
};
-
-/**
- * @param {number|string} keyId Either a Javascript key-code, or a PNaCl "code"
- * string.
- * @return {string} A human-readable representation of the key.
- * @private
- */
-ChordTracker.prototype.keyName_ = function(keyId) {
- if (typeof keyId == 'string') {
- return keyId;
- }
- var result = keyboardMap[keyId];
- if (!result) {
- result = '<' + keyId + '>';
- }
- return result;
-};

Powered by Google App Engine
This is Rietveld 408576698