Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 675 modifiers |= WebInputEvent::IsRight; | 675 modifiers |= WebInputEvent::IsRight; |
| 676 | 676 |
| 677 timeStampSeconds = event.timeStamp() / millisPerSecond; | 677 timeStampSeconds = event.timeStamp() / millisPerSecond; |
| 678 windowsKeyCode = event.keyCode(); | 678 windowsKeyCode = event.keyCode(); |
| 679 | 679 |
| 680 // The platform keyevent does not exist if the event was created using | 680 // The platform keyevent does not exist if the event was created using |
| 681 // initKeyboardEvent. | 681 // initKeyboardEvent. |
| 682 if (!event.keyEvent()) | 682 if (!event.keyEvent()) |
| 683 return; | 683 return; |
| 684 nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode(); | 684 nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode(); |
| 685 | |
|
Wez
2014/10/25 00:23:02
Why the extra blank line?
Habib Virji
2014/10/27 16:48:36
Acknowledged.
| |
| 685 unsigned numberOfCharacters = std::min(event.keyEvent()->text().length(), st atic_cast<unsigned>(textLengthCap)); | 686 unsigned numberOfCharacters = std::min(event.keyEvent()->text().length(), st atic_cast<unsigned>(textLengthCap)); |
| 686 for (unsigned i = 0; i < numberOfCharacters; ++i) { | 687 for (unsigned i = 0; i < numberOfCharacters; ++i) { |
| 687 text[i] = event.keyEvent()->text()[i]; | 688 text[i] = event.keyEvent()->text()[i]; |
| 688 unmodifiedText[i] = event.keyEvent()->unmodifiedText()[i]; | 689 unmodifiedText[i] = event.keyEvent()->unmodifiedText()[i]; |
| 689 } | 690 } |
| 690 memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), event.keyIdentif ier().length()); | 691 memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), event.keyIdentif ier().length()); |
| 691 } | 692 } |
| 692 | 693 |
| 693 WebInputEvent::Type toWebKeyboardEventType(PlatformEvent::Type type) | 694 WebInputEvent::Type toWebKeyboardEventType(PlatformEvent::Type type) |
| 694 { | 695 { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 826 modifiers = getWebInputModifiers(event); | 827 modifiers = getWebInputModifiers(event); |
| 827 | 828 |
| 828 globalX = event.screenX(); | 829 globalX = event.screenX(); |
| 829 globalY = event.screenY(); | 830 globalY = event.screenY(); |
| 830 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); | 831 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); |
| 831 x = localPoint.x(); | 832 x = localPoint.x(); |
| 832 y = localPoint.y(); | 833 y = localPoint.y(); |
| 833 } | 834 } |
| 834 | 835 |
| 835 } // namespace blink | 836 } // namespace blink |
| OLD | NEW |