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

Side by Side Diff: Source/devtools/front_end/ExtensionServer.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) 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 _onForwardKeyboardEvent: function(message) 574 _onForwardKeyboardEvent: function(message)
575 { 575 {
576 const Esc = "U+001B"; 576 const Esc = "U+001B";
577 577
578 if (!message.ctrlKey && !message.altKey && !message.metaKey && !/^F\d+$/ .test(message.keyIdentifier) && message.keyIdentifier !== Esc) 578 if (!message.ctrlKey && !message.altKey && !message.metaKey && !/^F\d+$/ .test(message.keyIdentifier) && message.keyIdentifier !== Esc)
579 return; 579 return;
580 // Fool around closure compiler -- it has its own notion of both Keyboar dEvent constructor 580 // Fool around closure compiler -- it has its own notion of both Keyboar dEvent constructor
581 // and initKeyboardEvent methods and overriding these in externs.js does not have effect. 581 // and initKeyboardEvent methods and overriding these in externs.js does not have effect.
582 var event = new window.KeyboardEvent(message.eventType, { 582 var event = new window.KeyboardEvent(message.eventType, {
583 keyIdentifier: message.keyIdentifier, 583 keyIdentifier: message.keyIdentifier,
584 keyLocation: message.keyLocation, 584 location: message.location,
585 ctrlKey: message.ctrlKey, 585 ctrlKey: message.ctrlKey,
586 altKey: message.altKey, 586 altKey: message.altKey,
587 shiftKey: message.shiftKey, 587 shiftKey: message.shiftKey,
588 metaKey: message.metaKey 588 metaKey: message.metaKey
589 }); 589 });
590 document.dispatchEvent(event); 590 document.dispatchEvent(event);
591 }, 591 },
592 592
593 _dispatchCallback: function(requestId, port, result) 593 _dispatchCallback: function(requestId, port, result)
594 { 594 {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 902
903 WebInspector.extensionServer = new WebInspector.ExtensionServer(); 903 WebInspector.extensionServer = new WebInspector.ExtensionServer();
904 904
905 window.addExtension = function(page, name) 905 window.addExtension = function(page, name)
906 { 906 {
907 WebInspector.extensionServer._addExtension({ 907 WebInspector.extensionServer._addExtension({
908 startPage: page, 908 startPage: page,
909 name: name, 909 name: name,
910 }); 910 });
911 } 911 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698