OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 var type; | 305 var type; |
306 switch (event.type) { | 306 switch (event.type) { |
307 case "keydown": type = "keyDown"; break; | 307 case "keydown": type = "keyDown"; break; |
308 case "keyup": type = "keyUp"; break; | 308 case "keyup": type = "keyUp"; break; |
309 case "keypress": type = "char"; break; | 309 case "keypress": type = "char"; break; |
310 default: return; | 310 default: return; |
311 } | 311 } |
312 | 312 |
313 var text = event.type === "keypress" ? String.fromCharCode(event.charCod
e) : undefined; | 313 var text = event.type === "keypress" ? String.fromCharCode(event.charCod
e) : undefined; |
314 InputAgent.dispatchKeyEvent(type, this._modifiersForEvent(event), event.
timeStamp / 1000, text, text ? text.toLowerCase() : undefined, | 314 InputAgent.dispatchKeyEvent(type, this._modifiersForEvent(event), event.
timeStamp / 1000, text, text ? text.toLowerCase() : undefined, |
315 event.keyIdentifier, event.keyCode /* window
sVirtualKeyCode */, event.keyCode /* nativeVirtualKeyCode */, undefined /* macCh
arCode */, false, false, false); | 315 event.keyIdentifier, event.keyCode /* window
sVirtualKeyCode */, event.keyCode /* nativeVirtualKeyCode */, false, false, fals
e); |
316 event.consume(); | 316 event.consume(); |
317 this._canvasElement.focus(); | 317 this._canvasElement.focus(); |
318 }, | 318 }, |
319 | 319 |
320 /** | 320 /** |
321 * @param {!Event} event | 321 * @param {!Event} event |
322 */ | 322 */ |
323 _handleContextMenuEvent: function(event) | 323 _handleContextMenuEvent: function(event) |
324 { | 324 { |
325 event.consume(true); | 325 event.consume(true); |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 * @return {!Element} | 984 * @return {!Element} |
985 */ | 985 */ |
986 statusBarItem: function() | 986 statusBarItem: function() |
987 { | 987 { |
988 if (this._initialized) | 988 if (this._initialized) |
989 return this._toggleScreencastButton.element; | 989 return this._toggleScreencastButton.element; |
990 this._statusBarPlaceholder = document.createElement("div"); | 990 this._statusBarPlaceholder = document.createElement("div"); |
991 return this._statusBarPlaceholder; | 991 return this._statusBarPlaceholder; |
992 } | 992 } |
993 }; | 993 }; |
OLD | NEW |