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

Side by Side Diff: Source/devtools/front_end/ExtensionAPI.js

Issue 20034002: Add support for KeyboardEvent.location attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
arv (Not doing code reviews) 2013/07/23 17:33:22 Maybe add: get keyLocation() { return this.keyL
do-not-use 2013/07/23 19:44:03 I don't understand this comment, sorry. Since I am
arv (Not doing code reviews) 2013/07/23 20:07:16 Ignore me. I thought this was part of something pu
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698