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

Side by Side Diff: third_party/WebKit/Source/core/events/WheelEvent.cpp

Issue 1894363004: Articulate the cancel behavior in WebMouseWheelEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_all_passive
Patch Set: Rebase Created 4 years, 8 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) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved.
6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 6 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 23 matching lines...) Expand all
34 return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA _PAGE : WheelEvent::DOM_DELTA_PIXEL; 34 return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA _PAGE : WheelEvent::DOM_DELTA_PIXEL;
35 } 35 }
36 36
37 WheelEvent* WheelEvent::create(const PlatformWheelEvent& event, AbstractView* vi ew) 37 WheelEvent* WheelEvent::create(const PlatformWheelEvent& event, AbstractView* vi ew)
38 { 38 {
39 return new WheelEvent(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()), 39 return new WheelEvent(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()),
40 convertDeltaMode(event), view, event.globalPosition(), event.position(), 40 convertDeltaMode(event), view, event.globalPosition(), event.position(),
41 event.getModifiers(), 41 event.getModifiers(),
42 MouseEvent::platformModifiersToButtons(event.getModifiers()), event.time stamp(), 42 MouseEvent::platformModifiersToButtons(event.getModifiers()), event.time stamp(),
43 event.canScroll(), event.resendingPluginId(), event.hasPreciseScrollingD eltas(), 43 event.canScroll(), event.resendingPluginId(), event.hasPreciseScrollingD eltas(),
44 static_cast<Event::RailsMode>(event.getRailsMode())); 44 static_cast<Event::RailsMode>(event.getRailsMode()),
45 event.cancelable());
45 } 46 }
46 47
47 WheelEvent::WheelEvent() 48 WheelEvent::WheelEvent()
48 : m_deltaX(0) 49 : m_deltaX(0)
49 , m_deltaY(0) 50 , m_deltaY(0)
50 , m_deltaZ(0) 51 , m_deltaZ(0)
51 , m_deltaMode(DOM_DELTA_PIXEL) 52 , m_deltaMode(DOM_DELTA_PIXEL)
52 , m_canScroll(true) 53 , m_canScroll(true)
53 , m_resendingPluginId(-1) 54 , m_resendingPluginId(-1)
54 , m_hasPreciseScrollingDeltas(false) 55 , m_hasPreciseScrollingDeltas(false)
(...skipping 11 matching lines...) Expand all
66 , m_canScroll(true) 67 , m_canScroll(true)
67 , m_resendingPluginId(-1) 68 , m_resendingPluginId(-1)
68 , m_hasPreciseScrollingDeltas(false) 69 , m_hasPreciseScrollingDeltas(false)
69 , m_railsMode(RailsModeFree) 70 , m_railsMode(RailsModeFree)
70 { 71 {
71 } 72 }
72 73
73 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode, 74 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode,
74 AbstractView* view, const IntPoint& screenLocation, const IntPoint& windowLo cation, 75 AbstractView* view, const IntPoint& screenLocation, const IntPoint& windowLo cation,
75 PlatformEvent::Modifiers modifiers, unsigned short buttons, double platformT imeStamp, 76 PlatformEvent::Modifiers modifiers, unsigned short buttons, double platformT imeStamp,
76 bool canScroll, int resendingPluginId, bool hasPreciseScrollingDeltas, Rails Mode railsMode) 77 bool canScroll, int resendingPluginId, bool hasPreciseScrollingDeltas, Rails Mode railsMode, bool cancelable)
77 : MouseEvent(EventTypeNames::wheel, true, true, view, 0, screenLocation.x(), screenLocation.y(), 78 : MouseEvent(EventTypeNames::wheel, true, cancelable, view, 0, screenLocatio n.x(), screenLocation.y(),
78 windowLocation.x(), windowLocation.y(), 0, 0, modifiers, 0, buttons, 79 windowLocation.x(), windowLocation.y(), 0, 0, modifiers, 0, buttons,
79 nullptr, platformTimeStamp, PlatformMouseEvent::RealOrIndistinguishable, 80 nullptr, platformTimeStamp, PlatformMouseEvent::RealOrIndistinguishable,
80 // TODO(zino): Should support canvas hit region because the wheel event 81 // TODO(zino): Should support canvas hit region because the wheel event
81 // is a kind of mouse event. Please see http://crbug.com/594075 82 // is a kind of mouse event. Please see http://crbug.com/594075
82 String()) 83 String())
83 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl ier) 84 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl ier)
84 , m_deltaX(-rawDelta.x()) 85 , m_deltaX(-rawDelta.x())
85 , m_deltaY(-rawDelta.y()) 86 , m_deltaY(-rawDelta.y())
86 , m_deltaZ(0) 87 , m_deltaZ(0)
87 , m_deltaMode(deltaMode) 88 , m_deltaMode(deltaMode)
(...skipping 23 matching lines...) Expand all
111 { 112 {
112 return EventDispatchMediator::create(this); 113 return EventDispatchMediator::create(this);
113 } 114 }
114 115
115 DEFINE_TRACE(WheelEvent) 116 DEFINE_TRACE(WheelEvent)
116 { 117 {
117 MouseEvent::trace(visitor); 118 MouseEvent::trace(visitor);
118 } 119 }
119 120
120 } // namespace blink 121 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/WheelEvent.h ('k') | third_party/WebKit/Source/platform/PlatformWheelEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698