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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 if (e.modifiers & WebInputEvent::ShiftKey) | 147 if (e.modifiers & WebInputEvent::ShiftKey) |
148 m_modifiers |= PlatformEvent::ShiftKey; | 148 m_modifiers |= PlatformEvent::ShiftKey; |
149 if (e.modifiers & WebInputEvent::ControlKey) | 149 if (e.modifiers & WebInputEvent::ControlKey) |
150 m_modifiers |= PlatformEvent::CtrlKey; | 150 m_modifiers |= PlatformEvent::CtrlKey; |
151 if (e.modifiers & WebInputEvent::AltKey) | 151 if (e.modifiers & WebInputEvent::AltKey) |
152 m_modifiers |= PlatformEvent::AltKey; | 152 m_modifiers |= PlatformEvent::AltKey; |
153 if (e.modifiers & WebInputEvent::MetaKey) | 153 if (e.modifiers & WebInputEvent::MetaKey) |
154 m_modifiers |= PlatformEvent::MetaKey; | 154 m_modifiers |= PlatformEvent::MetaKey; |
155 | 155 |
156 m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas; | 156 m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas; |
157 m_suppressScroll = e.suppressScroll; | |
157 #if OS(MACOSX) | 158 #if OS(MACOSX) |
158 m_phase = static_cast<PlatformWheelEventPhase>(e.phase); | 159 m_phase = static_cast<PlatformWheelEventPhase>(e.phase); |
159 m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase); | 160 m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase); |
160 m_timestamp = e.timeStampSeconds; | 161 m_timestamp = e.timeStampSeconds; |
161 m_canRubberbandLeft = e.canRubberbandLeft; | 162 m_canRubberbandLeft = e.canRubberbandLeft; |
162 m_canRubberbandRight = e.canRubberbandRight; | 163 m_canRubberbandRight = e.canRubberbandRight; |
163 #endif | 164 #endif |
164 } | 165 } |
165 | 166 |
166 // PlatformGestureEventBuilder ------------------------------------------------- - | 167 // PlatformGestureEventBuilder ------------------------------------------------- - |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
632 | 633 |
633 WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const RenderObject* renderObject, const WheelEvent& event) | 634 WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const RenderObject* renderObject, const WheelEvent& event) |
634 { | 635 { |
635 if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames: :mousewheel) | 636 if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames: :mousewheel) |
636 return; | 637 return; |
637 type = WebInputEvent::MouseWheel; | 638 type = WebInputEvent::MouseWheel; |
638 updateWebMouseEventFromCoreMouseEvent(event, widget, *renderObject, *this); | 639 updateWebMouseEventFromCoreMouseEvent(event, widget, *renderObject, *this); |
639 deltaX = -event.deltaX(); | 640 deltaX = -event.deltaX(); |
640 deltaY = -event.deltaY(); | 641 deltaY = -event.deltaY(); |
641 wheelTicksX = event.ticksX(); | 642 wheelTicksX = event.ticksX(); |
642 wheelTicksY = event.ticksY(); | 643 wheelTicksY = event.ticksY(); |
Rick Byers
2014/11/27 15:55:14
Since you ended up having to propagate your new bi
lanwei
2014/12/02 06:28:22
Done.
| |
643 scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE; | 644 scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE; |
644 } | 645 } |
645 | 646 |
646 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) | 647 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) |
647 { | 648 { |
648 if (event.type() == EventTypeNames::keydown) | 649 if (event.type() == EventTypeNames::keydown) |
649 type = KeyDown; | 650 type = KeyDown; |
650 else if (event.type() == EventTypeNames::keyup) | 651 else if (event.type() == EventTypeNames::keyup) |
651 type = WebInputEvent::KeyUp; | 652 type = WebInputEvent::KeyUp; |
652 else if (event.type() == EventTypeNames::keypress) | 653 else if (event.type() == EventTypeNames::keypress) |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
814 modifiers = getWebInputModifiers(event); | 815 modifiers = getWebInputModifiers(event); |
815 | 816 |
816 globalX = event.screenX(); | 817 globalX = event.screenX(); |
817 globalY = event.screenY(); | 818 globalY = event.screenY(); |
818 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); | 819 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); |
819 x = localPoint.x(); | 820 x = localPoint.x(); |
820 y = localPoint.y(); | 821 y = localPoint.y(); |
821 } | 822 } |
822 | 823 |
823 } // namespace blink | 824 } // namespace blink |
OLD | NEW |