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

Side by Side Diff: Source/web/WebInputEventConversion.cpp

Issue 1018183002: Add rails to input wheel events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More plumbing and tests Created 5 years, 9 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 | « Source/web/WebInputEvent.cpp ('k') | Source/web/tests/WebInputEventConversionTest.cpp » ('j') | 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 m_wheelTicksY = e.wheelTicksY; 193 m_wheelTicksY = e.wheelTicksY;
194 m_granularity = e.scrollByPage ? 194 m_granularity = e.scrollByPage ?
195 ScrollByPageWheelEvent : ScrollByPixelWheelEvent; 195 ScrollByPageWheelEvent : ScrollByPixelWheelEvent;
196 196
197 m_type = PlatformEvent::Wheel; 197 m_type = PlatformEvent::Wheel;
198 198
199 m_modifiers = toPlatformMouseEventModifiers(e.modifiers); 199 m_modifiers = toPlatformMouseEventModifiers(e.modifiers);
200 200
201 m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas; 201 m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas;
202 m_canScroll = e.canScroll; 202 m_canScroll = e.canScroll;
203 m_railsMode = static_cast<PlatformEvent::RailsMode>(e.railsMode);
203 #if OS(MACOSX) 204 #if OS(MACOSX)
204 m_phase = static_cast<PlatformWheelEventPhase>(e.phase); 205 m_phase = static_cast<PlatformWheelEventPhase>(e.phase);
205 m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase); 206 m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase);
206 m_timestamp = e.timeStampSeconds; 207 m_timestamp = e.timeStampSeconds;
207 m_canRubberbandLeft = e.canRubberbandLeft; 208 m_canRubberbandLeft = e.canRubberbandLeft;
208 m_canRubberbandRight = e.canRubberbandRight; 209 m_canRubberbandRight = e.canRubberbandRight;
209 #endif 210 #endif
210 } 211 }
211 212
212 // PlatformGestureEventBuilder ------------------------------------------------- - 213 // PlatformGestureEventBuilder ------------------------------------------------- -
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames: :mousewheel) 643 if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames: :mousewheel)
643 return; 644 return;
644 type = WebInputEvent::MouseWheel; 645 type = WebInputEvent::MouseWheel;
645 updateWebMouseEventFromCoreMouseEvent(event, widget, *layoutObject, *this); 646 updateWebMouseEventFromCoreMouseEvent(event, widget, *layoutObject, *this);
646 deltaX = -event.deltaX(); 647 deltaX = -event.deltaX();
647 deltaY = -event.deltaY(); 648 deltaY = -event.deltaY();
648 wheelTicksX = event.ticksX(); 649 wheelTicksX = event.ticksX();
649 wheelTicksY = event.ticksY(); 650 wheelTicksY = event.ticksY();
650 scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE; 651 scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE;
651 canScroll = event.canScroll(); 652 canScroll = event.canScroll();
653 railsMode = static_cast<RailsMode>(event.railsMode());
652 } 654 }
653 655
654 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) 656 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
655 { 657 {
656 if (event.type() == EventTypeNames::keydown) 658 if (event.type() == EventTypeNames::keydown)
657 type = KeyDown; 659 type = KeyDown;
658 else if (event.type() == EventTypeNames::keyup) 660 else if (event.type() == EventTypeNames::keyup)
659 type = WebInputEvent::KeyUp; 661 type = WebInputEvent::KeyUp;
660 else if (event.type() == EventTypeNames::keypress) 662 else if (event.type() == EventTypeNames::keypress)
661 type = WebInputEvent::Char; 663 type = WebInputEvent::Char;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 modifiers = getWebInputModifiers(event); 813 modifiers = getWebInputModifiers(event);
812 814
813 globalX = event.screenX(); 815 globalX = event.screenX();
814 globalY = event.screenY(); 816 globalY = event.screenY();
815 IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteL ocation(), *layoutObject); 817 IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteL ocation(), *layoutObject);
816 x = localPoint.x(); 818 x = localPoint.x();
817 y = localPoint.y(); 819 y = localPoint.y();
818 } 820 }
819 821
820 } // namespace blink 822 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebInputEvent.cpp ('k') | Source/web/tests/WebInputEventConversionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698