| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 m_modifiers |= PlatformEvent::CtrlKey; | 450 m_modifiers |= PlatformEvent::CtrlKey; |
| 451 if (event.modifiers & WebInputEvent::AltKey) | 451 if (event.modifiers & WebInputEvent::AltKey) |
| 452 m_modifiers |= PlatformEvent::AltKey; | 452 m_modifiers |= PlatformEvent::AltKey; |
| 453 if (event.modifiers & WebInputEvent::MetaKey) | 453 if (event.modifiers & WebInputEvent::MetaKey) |
| 454 m_modifiers |= PlatformEvent::MetaKey; | 454 m_modifiers |= PlatformEvent::MetaKey; |
| 455 | 455 |
| 456 m_timestamp = event.timeStampSeconds; | 456 m_timestamp = event.timeStampSeconds; |
| 457 | 457 |
| 458 for (unsigned i = 0; i < event.touchesLength; ++i) | 458 for (unsigned i = 0; i < event.touchesLength; ++i) |
| 459 m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touches[i])
); | 459 m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touches[i])
); |
| 460 |
| 461 m_cancelable = event.cancelable; |
| 460 } | 462 } |
| 461 | 463 |
| 462 static int getWebInputModifiers(const UIEventWithKeyState& event) | 464 static int getWebInputModifiers(const UIEventWithKeyState& event) |
| 463 { | 465 { |
| 464 int modifiers = 0; | 466 int modifiers = 0; |
| 465 if (event.ctrlKey()) | 467 if (event.ctrlKey()) |
| 466 modifiers |= WebInputEvent::ControlKey; | 468 modifiers |= WebInputEvent::ControlKey; |
| 467 if (event.shiftKey()) | 469 if (event.shiftKey()) |
| 468 modifiers |= WebInputEvent::ShiftKey; | 470 modifiers |= WebInputEvent::ShiftKey; |
| 469 if (event.altKey()) | 471 if (event.altKey()) |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 else if (event.type() == EventTypeNames::touchcancel) | 755 else if (event.type() == EventTypeNames::touchcancel) |
| 754 type = TouchCancel; | 756 type = TouchCancel; |
| 755 else { | 757 else { |
| 756 ASSERT_NOT_REACHED(); | 758 ASSERT_NOT_REACHED(); |
| 757 type = Undefined; | 759 type = Undefined; |
| 758 return; | 760 return; |
| 759 } | 761 } |
| 760 | 762 |
| 761 modifiers = getWebInputModifiers(event); | 763 modifiers = getWebInputModifiers(event); |
| 762 timeStampSeconds = event.timeStamp() / millisPerSecond; | 764 timeStampSeconds = event.timeStamp() / millisPerSecond; |
| 765 cancelable = event.cancelable(); |
| 763 | 766 |
| 764 addTouchPoints(widget, event.type(), event.touches(), touches, &touchesLengt
h, renderObject); | 767 addTouchPoints(widget, event.type(), event.touches(), touches, &touchesLengt
h, renderObject); |
| 765 addTouchPoints(widget, event.type(), event.changedTouches(), changedTouches,
&changedTouchesLength, renderObject); | 768 addTouchPoints(widget, event.type(), event.changedTouches(), changedTouches,
&changedTouchesLength, renderObject); |
| 766 addTouchPoints(widget, event.type(), event.targetTouches(), targetTouches, &
targetTouchesLength, renderObject); | 769 addTouchPoints(widget, event.type(), event.targetTouches(), targetTouches, &
targetTouchesLength, renderObject); |
| 767 } | 770 } |
| 768 | 771 |
| 769 WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const WebCo
re::RenderObject* renderObject, const GestureEvent& event) | 772 WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const WebCo
re::RenderObject* renderObject, const GestureEvent& event) |
| 770 { | 773 { |
| 771 if (event.type() == EventTypeNames::gestureshowpress) | 774 if (event.type() == EventTypeNames::gestureshowpress) |
| 772 type = GestureShowPress; | 775 type = GestureShowPress; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 789 modifiers = getWebInputModifiers(event); | 792 modifiers = getWebInputModifiers(event); |
| 790 | 793 |
| 791 globalX = event.screenX(); | 794 globalX = event.screenX(); |
| 792 globalY = event.screenY(); | 795 globalY = event.screenY(); |
| 793 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); | 796 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); |
| 794 x = localPoint.x(); | 797 x = localPoint.x(); |
| 795 y = localPoint.y(); | 798 y = localPoint.y(); |
| 796 } | 799 } |
| 797 | 800 |
| 798 } // namespace blink | 801 } // namespace blink |
| OLD | NEW |