| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 // We only care about global hotkeys, not about random text | 731 // We only care about global hotkeys, not about random text |
| 732 if (!event.ctrlKey && !event.altKey && !event.metaKey && !/^F\d+$/.test(even
t.keyIdentifier) && event.keyIdentifier !== Esc) | 732 if (!event.ctrlKey && !event.altKey && !event.metaKey && !/^F\d+$/.test(even
t.keyIdentifier) && event.keyIdentifier !== Esc) |
| 733 return; | 733 return; |
| 734 var request = { | 734 var request = { |
| 735 command: commands.ForwardKeyboardEvent, | 735 command: commands.ForwardKeyboardEvent, |
| 736 eventType: event.type, | 736 eventType: event.type, |
| 737 ctrlKey: event.ctrlKey, | 737 ctrlKey: event.ctrlKey, |
| 738 altKey: event.altKey, | 738 altKey: event.altKey, |
| 739 metaKey: event.metaKey, | 739 metaKey: event.metaKey, |
| 740 keyIdentifier: event.keyIdentifier, | 740 keyIdentifier: event.keyIdentifier, |
| 741 keyLocation: event.keyLocation | 741 location: event.location |
| 742 }; | 742 }; |
| 743 extensionServer.sendRequest(request); | 743 extensionServer.sendRequest(request); |
| 744 } | 744 } |
| 745 | 745 |
| 746 document.addEventListener("keydown", forwardKeyboardEvent, false); | 746 document.addEventListener("keydown", forwardKeyboardEvent, false); |
| 747 document.addEventListener("keypress", forwardKeyboardEvent, false); | 747 document.addEventListener("keypress", forwardKeyboardEvent, false); |
| 748 | 748 |
| 749 /** | 749 /** |
| 750 * @constructor | 750 * @constructor |
| 751 */ | 751 */ |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 { | 898 { |
| 899 return "(function(injectedScriptId){ " + | 899 return "(function(injectedScriptId){ " + |
| 900 "var extensionServer;" + | 900 "var extensionServer;" + |
| 901 defineCommonExtensionSymbols.toString() + ";" + | 901 defineCommonExtensionSymbols.toString() + ";" + |
| 902 injectedExtensionAPI.toString() + ";" + | 902 injectedExtensionAPI.toString() + ";" + |
| 903 buildPlatformExtensionAPI(extensionInfo) + ";" + | 903 buildPlatformExtensionAPI(extensionInfo) + ";" + |
| 904 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + | 904 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + |
| 905 "return {};" + | 905 "return {};" + |
| 906 "})"; | 906 "})"; |
| 907 } | 907 } |
| OLD | NEW |