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

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

Issue 2227803003: Plumb phase/momentum for WheelEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Non-Mac compile. Created 4 years, 4 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
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 m_timestamp = e.timeStampSeconds; 229 m_timestamp = e.timeStampSeconds;
230 m_modifiers = e.modifiers; 230 m_modifiers = e.modifiers;
231 m_dispatchType = toPlatformDispatchType(e.dispatchType); 231 m_dispatchType = toPlatformDispatchType(e.dispatchType);
232 232
233 m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas; 233 m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas;
234 m_resendingPluginId = e.resendingPluginId; 234 m_resendingPluginId = e.resendingPluginId;
235 m_railsMode = static_cast<PlatformEvent::RailsMode>(e.railsMode); 235 m_railsMode = static_cast<PlatformEvent::RailsMode>(e.railsMode);
236 #if OS(MACOSX) 236 #if OS(MACOSX)
237 m_phase = static_cast<PlatformWheelEventPhase>(e.phase); 237 m_phase = static_cast<PlatformWheelEventPhase>(e.phase);
238 m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase); 238 m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase);
239 m_canRubberbandLeft = e.canRubberbandLeft;
240 m_canRubberbandRight = e.canRubberbandRight;
241 #endif 239 #endif
242 } 240 }
243 241
244 // PlatformGestureEventBuilder ------------------------------------------------- - 242 // PlatformGestureEventBuilder ------------------------------------------------- -
245 243
246 PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W ebGestureEvent& e) 244 PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W ebGestureEvent& e)
247 { 245 {
248 switch (e.type) { 246 switch (e.type) {
249 case WebInputEvent::GestureScrollBegin: 247 case WebInputEvent::GestureScrollBegin:
250 m_type = PlatformEvent::GestureScrollBegin; 248 m_type = PlatformEvent::GestureScrollBegin;
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 updateWebMouseEventFromCoreMouseEvent(event, widget, layoutItem, *this); 632 updateWebMouseEventFromCoreMouseEvent(event, widget, layoutItem, *this);
635 deltaX = -event.deltaX(); 633 deltaX = -event.deltaX();
636 deltaY = -event.deltaY(); 634 deltaY = -event.deltaY();
637 wheelTicksX = event.ticksX(); 635 wheelTicksX = event.ticksX();
638 wheelTicksY = event.ticksY(); 636 wheelTicksY = event.ticksY();
639 scrollByPage = event.deltaMode() == WheelEvent::kDomDeltaPage; 637 scrollByPage = event.deltaMode() == WheelEvent::kDomDeltaPage;
640 resendingPluginId = event.resendingPluginId(); 638 resendingPluginId = event.resendingPluginId();
641 railsMode = static_cast<RailsMode>(event.getRailsMode()); 639 railsMode = static_cast<RailsMode>(event.getRailsMode());
642 hasPreciseScrollingDeltas = event.hasPreciseScrollingDeltas(); 640 hasPreciseScrollingDeltas = event.hasPreciseScrollingDeltas();
643 dispatchType = event.cancelable() ? WebInputEvent::Blocking : WebInputEvent: :EventNonBlocking; 641 dispatchType = event.cancelable() ? WebInputEvent::Blocking : WebInputEvent: :EventNonBlocking;
642 #if OS(MACOSX)
643 phase = static_cast<Phase>(event.phase());
644 momentumPhase = static_cast<Phase>(event.momentumPhase());
645 #endif
644 } 646 }
645 647
646 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) 648 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
647 { 649 {
648 if (event.type() == EventTypeNames::keydown) 650 if (event.type() == EventTypeNames::keydown)
649 type = KeyDown; 651 type = KeyDown;
650 else if (event.type() == EventTypeNames::keyup) 652 else if (event.type() == EventTypeNames::keyup)
651 type = WebInputEvent::KeyUp; 653 type = WebInputEvent::KeyUp;
652 else if (event.type() == EventTypeNames::keypress) 654 else if (event.type() == EventTypeNames::keypress)
653 type = WebInputEvent::Char; 655 type = WebInputEvent::Char;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 break; 818 break;
817 case GestureSourceTouchscreen: 819 case GestureSourceTouchscreen:
818 sourceDevice = WebGestureDeviceTouchscreen; 820 sourceDevice = WebGestureDeviceTouchscreen;
819 break; 821 break;
820 case GestureSourceUninitialized: 822 case GestureSourceUninitialized:
821 NOTREACHED(); 823 NOTREACHED();
822 } 824 }
823 } 825 }
824 826
825 } // namespace blink 827 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698