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

Side by Side Diff: Source/WebKit/chromium/src/WebInputEventConversion.cpp

Issue 15320003: Fix WebInputEventConversion conversion from Platform to Web KeyboardEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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
« no previous file with comments | « LayoutTests/inspector-protocol/input/dispatchKeyEvent-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 if (event.isAutoRepeat()) 616 if (event.isAutoRepeat())
617 modifiers |= WebInputEvent::IsAutoRepeat; 617 modifiers |= WebInputEvent::IsAutoRepeat;
618 if (event.isKeypad()) 618 if (event.isKeypad())
619 modifiers |= WebInputEvent::IsKeyPad; 619 modifiers |= WebInputEvent::IsKeyPad;
620 isSystemKey = event.isSystemKey(); 620 isSystemKey = event.isSystemKey();
621 nativeKeyCode = event.nativeVirtualKeyCode(); 621 nativeKeyCode = event.nativeVirtualKeyCode();
622 622
623 windowsKeyCode = windowsKeyCodeWithoutLocation(event.windowsVirtualKeyCode() ); 623 windowsKeyCode = windowsKeyCodeWithoutLocation(event.windowsVirtualKeyCode() );
624 modifiers |= locationModifiersFromWindowsKeyCode(event.windowsVirtualKeyCode ()); 624 modifiers |= locationModifiersFromWindowsKeyCode(event.windowsVirtualKeyCode ());
625 625
626 memcpy(text, event.text().characters(), std::min(static_cast<unsigned>(textL engthCap), event.text().length())); 626 memcpy(text, event.text().characters(), std::min(static_cast<unsigned>(textL engthCap), event.text().length()) * sizeof(UChar));
627 memcpy(unmodifiedText, event.unmodifiedText().characters(), std::min(static_ cast<unsigned>(textLengthCap), event.unmodifiedText().length())); 627 memcpy(unmodifiedText, event.unmodifiedText().characters(), std::min(static_ cast<unsigned>(textLengthCap), event.unmodifiedText().length()) * sizeof(UChar)) ;
628 memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), std::min(static_ cast<unsigned>(keyIdentifierLengthCap), event.keyIdentifier().length())); 628 memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), std::min(static_ cast<unsigned>(keyIdentifierLengthCap), event.keyIdentifier().length()));
629 } 629 }
630 630
631 static void addTouchPoints(const Widget* widget, const AtomicString& touchType, TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, con st WebCore::RenderObject* renderObject) 631 static void addTouchPoints(const Widget* widget, const AtomicString& touchType, TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, con st WebCore::RenderObject* renderObject)
632 { 632 {
633 unsigned numberOfTouches = std::min(touches->length(), static_cast<unsigned> (WebTouchEvent::touchesLengthCap)); 633 unsigned numberOfTouches = std::min(touches->length(), static_cast<unsigned> (WebTouchEvent::touchesLengthCap));
634 for (unsigned i = 0; i < numberOfTouches; ++i) { 634 for (unsigned i = 0; i < numberOfTouches; ++i) {
635 const Touch* touch = touches->item(i); 635 const Touch* touch = touches->item(i);
636 636
637 WebTouchPoint point; 637 WebTouchPoint point;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 modifiers = getWebInputModifiers(event); 693 modifiers = getWebInputModifiers(event);
694 694
695 globalX = event.screenX(); 695 globalX = event.screenX();
696 globalY = event.screenY(); 696 globalY = event.screenY();
697 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); 697 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject);
698 x = localPoint.x(); 698 x = localPoint.x();
699 y = localPoint.y(); 699 y = localPoint.y();
700 } 700 }
701 701
702 } // namespace WebKit 702 } // namespace WebKit
OLDNEW
« no previous file with comments | « LayoutTests/inspector-protocol/input/dispatchKeyEvent-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698