OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 603 matching lines...) Loading... |
614 _onStopAuditCategoryRun: function(message) | 614 _onStopAuditCategoryRun: function(message) |
615 { | 615 { |
616 var auditRun = /** {!WebInspector.ExtensionAuditCategoryResults} */ (thi
s._clientObjects[message.resultId]); | 616 var auditRun = /** {!WebInspector.ExtensionAuditCategoryResults} */ (thi
s._clientObjects[message.resultId]); |
617 if (!auditRun) | 617 if (!auditRun) |
618 return this._status.E_NOTFOUND(message.resultId); | 618 return this._status.E_NOTFOUND(message.resultId); |
619 auditRun.done(); | 619 auditRun.done(); |
620 }, | 620 }, |
621 | 621 |
622 _onForwardKeyboardEvent: function(message) | 622 _onForwardKeyboardEvent: function(message) |
623 { | 623 { |
624 const Esc = "U+001B"; | |
625 message.entries.forEach(handleEventEntry); | 624 message.entries.forEach(handleEventEntry); |
626 | 625 |
627 /** | 626 /** |
628 * @param {*} entry | 627 * @param {*} entry |
629 * @suppressGlobalPropertiesCheck | 628 * @suppressGlobalPropertiesCheck |
630 */ | 629 */ |
631 function handleEventEntry(entry) | 630 function handleEventEntry(entry) |
632 { | 631 { |
633 if (!entry.ctrlKey && !entry.altKey && !entry.metaKey && !/^F\d+$/.t
est(entry.keyIdentifier) && entry.keyIdentifier !== Esc) | 632 if (!entry.ctrlKey && !entry.altKey && !entry.metaKey && !/^F\d+$/.t
est(entry.key) && entry.key !== "Escape") |
634 return; | 633 return; |
635 // Fool around closure compiler -- it has its own notion of both Key
boardEvent constructor | 634 // Fool around closure compiler -- it has its own notion of both Key
boardEvent constructor |
636 // and initKeyboardEvent methods and overriding these in externs.js
does not have effect. | 635 // and initKeyboardEvent methods and overriding these in externs.js
does not have effect. |
637 var event = new window.KeyboardEvent(entry.eventType, { | 636 var event = new window.KeyboardEvent(entry.eventType, { |
638 keyIdentifier: entry.keyIdentifier, | 637 keyIdentifier: entry.keyIdentifier, |
| 638 key: entry.key, |
| 639 code: entry.code, |
| 640 keyCode: entry.keyCode, |
639 location: entry.location, | 641 location: entry.location, |
640 ctrlKey: entry.ctrlKey, | 642 ctrlKey: entry.ctrlKey, |
641 altKey: entry.altKey, | 643 altKey: entry.altKey, |
642 shiftKey: entry.shiftKey, | 644 shiftKey: entry.shiftKey, |
643 metaKey: entry.metaKey | 645 metaKey: entry.metaKey |
644 }); | 646 }); |
645 event.__keyCode = keyCodeForEntry(entry); | 647 event.__keyCode = keyCodeForEntry(entry); |
646 document.dispatchEvent(event); | 648 document.dispatchEvent(event); |
647 } | 649 } |
648 | 650 |
(...skipping 422 matching lines...) Loading... |
1071 /** | 1073 /** |
1072 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1074 * @typedef {{code: string, description: string, details: !Array.<*>}} |
1073 */ | 1075 */ |
1074 WebInspector.ExtensionStatus.Record; | 1076 WebInspector.ExtensionStatus.Record; |
1075 | 1077 |
1076 WebInspector.extensionAPI = {}; | 1078 WebInspector.extensionAPI = {}; |
1077 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1079 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
1078 | 1080 |
1079 /** @type {!WebInspector.ExtensionServer} */ | 1081 /** @type {!WebInspector.ExtensionServer} */ |
1080 WebInspector.extensionServer; | 1082 WebInspector.extensionServer; |
OLD | NEW |