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

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

Issue 1308313005: Modify gesture event types for WebView-tag scroll bubbling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment to explain |resendingPluginId|. Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/events/WheelEvent.h ('k') | Source/platform/PlatformGestureEvent.h » ('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) 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 { 34 {
35 return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA _PAGE : WheelEvent::DOM_DELTA_PIXEL; 35 return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA _PAGE : WheelEvent::DOM_DELTA_PIXEL;
36 } 36 }
37 37
38 PassRefPtrWillBeRawPtr<WheelEvent> WheelEvent::create(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view) 38 PassRefPtrWillBeRawPtr<WheelEvent> WheelEvent::create(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view)
39 { 39 {
40 return adoptRefWillBeNoop(new WheelEvent(FloatPoint(event.wheelTicksX(), eve nt.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()), 40 return adoptRefWillBeNoop(new WheelEvent(FloatPoint(event.wheelTicksX(), eve nt.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()),
41 convertDeltaMode(event), view, event.globalPosition(), event.position(), 41 convertDeltaMode(event), view, event.globalPosition(), event.position(),
42 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 42 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
43 MouseEvent::platformModifiersToButtons(event.modifiers()), 43 MouseEvent::platformModifiersToButtons(event.modifiers()),
44 event.canScroll(), event.hasPreciseScrollingDeltas(), 44 event.canScroll(), event.resendingPluginId(), event.hasPreciseScrollingD eltas(),
45 static_cast<Event::RailsMode>(event.railsMode()))); 45 static_cast<Event::RailsMode>(event.railsMode())));
46 } 46 }
47 47
48 WheelEvent::WheelEvent() 48 WheelEvent::WheelEvent()
49 : m_deltaX(0) 49 : m_deltaX(0)
50 , m_deltaY(0) 50 , m_deltaY(0)
51 , m_deltaZ(0) 51 , m_deltaZ(0)
52 , m_deltaMode(DOM_DELTA_PIXEL) 52 , m_deltaMode(DOM_DELTA_PIXEL)
53 , m_canScroll(true) 53 , m_canScroll(true)
54 , m_resendingPluginId(-1)
54 , m_hasPreciseScrollingDeltas(false) 55 , m_hasPreciseScrollingDeltas(false)
55 , m_railsMode(RailsModeFree) 56 , m_railsMode(RailsModeFree)
56 { 57 {
57 } 58 }
58 59
59 WheelEvent::WheelEvent(const AtomicString& type, const WheelEventInit& initializ er) 60 WheelEvent::WheelEvent(const AtomicString& type, const WheelEventInit& initializ er)
60 : MouseEvent(type, initializer) 61 : MouseEvent(type, initializer)
61 , m_wheelDelta(initializer.wheelDeltaX() ? initializer.wheelDeltaX() : -init ializer.deltaX(), initializer.wheelDeltaY() ? initializer.wheelDeltaY() : -initi alizer.deltaY()) 62 , m_wheelDelta(initializer.wheelDeltaX() ? initializer.wheelDeltaX() : -init ializer.deltaX(), initializer.wheelDeltaY() ? initializer.wheelDeltaY() : -initi alizer.deltaY())
62 , m_deltaX(initializer.deltaX() ? initializer.deltaX() : -initializer.wheelD eltaX()) 63 , m_deltaX(initializer.deltaX() ? initializer.deltaX() : -initializer.wheelD eltaX())
63 , m_deltaY(initializer.deltaY() ? initializer.deltaY() : -initializer.wheelD eltaY()) 64 , m_deltaY(initializer.deltaY() ? initializer.deltaY() : -initializer.wheelD eltaY())
64 , m_deltaZ(initializer.deltaZ()) 65 , m_deltaZ(initializer.deltaZ())
65 , m_deltaMode(initializer.deltaMode()) 66 , m_deltaMode(initializer.deltaMode())
66 , m_canScroll(true) 67 , m_canScroll(true)
68 , m_resendingPluginId(-1)
67 , m_hasPreciseScrollingDeltas(false) 69 , m_hasPreciseScrollingDeltas(false)
68 , m_railsMode(RailsModeFree) 70 , m_railsMode(RailsModeFree)
69 { 71 {
70 } 72 }
71 73
72 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode, 74 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode,
73 PassRefPtrWillBeRawPtr<AbstractView> view, const IntPoint& screenLocation, c onst IntPoint& windowLocation, 75 PassRefPtrWillBeRawPtr<AbstractView> view, const IntPoint& screenLocation, c onst IntPoint& windowLocation,
74 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short butto ns, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode railsMode) 76 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short butto ns, bool canScroll, int resendingPluginId, bool hasPreciseScrollingDeltas, Rails Mode railsMode)
75 : MouseEvent(EventTypeNames::wheel, true, true, view, 0, screenLocation.x(), screenLocation.y(), 77 : MouseEvent(EventTypeNames::wheel, true, true, view, 0, screenLocation.x(), screenLocation.y(),
76 windowLocation.x(), windowLocation.y(), 0, 0, ctrlKey, altKey, shiftKey, metaKey, 0, buttons, 78 windowLocation.x(), windowLocation.y(), 0, 0, ctrlKey, altKey, shiftKey, metaKey, 0, buttons,
77 nullptr, PlatformMouseEvent::RealOrIndistinguishable) 79 nullptr, PlatformMouseEvent::RealOrIndistinguishable)
78 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl ier) 80 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl ier)
79 , m_deltaX(-rawDelta.x()) 81 , m_deltaX(-rawDelta.x())
80 , m_deltaY(-rawDelta.y()) 82 , m_deltaY(-rawDelta.y())
81 , m_deltaZ(0) 83 , m_deltaZ(0)
82 , m_deltaMode(deltaMode) 84 , m_deltaMode(deltaMode)
83 , m_canScroll(canScroll) 85 , m_canScroll(canScroll)
86 , m_resendingPluginId(resendingPluginId)
84 , m_hasPreciseScrollingDeltas(hasPreciseScrollingDeltas) 87 , m_hasPreciseScrollingDeltas(hasPreciseScrollingDeltas)
85 , m_railsMode(railsMode) 88 , m_railsMode(railsMode)
86 { 89 {
87 } 90 }
88 91
89 const AtomicString& WheelEvent::interfaceName() const 92 const AtomicString& WheelEvent::interfaceName() const
90 { 93 {
91 return EventNames::WheelEvent; 94 return EventNames::WheelEvent;
92 } 95 }
93 96
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 { 128 {
126 return toWheelEvent(EventDispatchMediator::event()); 129 return toWheelEvent(EventDispatchMediator::event());
127 } 130 }
128 131
129 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons t 132 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons t
130 { 133 {
131 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled(); 134 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled();
132 } 135 }
133 136
134 } // namespace blink 137 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/events/WheelEvent.h ('k') | Source/platform/PlatformGestureEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698