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

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

Issue 727593003: Implement MouseEvent buttons attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: nits Created 6 years 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/core/events/WheelEvent.h ('k') | Source/core/page/EventHandler.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) 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 , m_wheelDelta(initializer.wheelDeltaX ? initializer.wheelDeltaX : -initiali zer.deltaX, initializer.wheelDeltaY ? initializer.wheelDeltaY : -initializer.del taY) 53 , m_wheelDelta(initializer.wheelDeltaX ? initializer.wheelDeltaX : -initiali zer.deltaX, initializer.wheelDeltaY ? initializer.wheelDeltaY : -initializer.del taY)
54 , m_deltaX(initializer.deltaX ? initializer.deltaX : -initializer.wheelDelta X) 54 , m_deltaX(initializer.deltaX ? initializer.deltaX : -initializer.wheelDelta X)
55 , m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDelta Y) 55 , m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDelta Y)
56 , m_deltaZ(initializer.deltaZ) 56 , m_deltaZ(initializer.deltaZ)
57 , m_deltaMode(initializer.deltaMode) 57 , m_deltaMode(initializer.deltaMode)
58 { 58 {
59 } 59 }
60 60
61 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode, 61 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode,
62 PassRefPtrWillBeRawPtr<AbstractView> view, const IntPoint& screenLocation, c onst IntPoint& pageLocation, 62 PassRefPtrWillBeRawPtr<AbstractView> view, const IntPoint& screenLocation, c onst IntPoint& pageLocation,
63 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) 63 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short butto ns)
64 : MouseEvent(EventTypeNames::wheel, true, true, view, 0, screenLocation.x(), screenLocation.y(), 64 : MouseEvent(EventTypeNames::wheel, true, true, view, 0, screenLocation.x(), screenLocation.y(),
65 pageLocation.x(), pageLocation.y(), 0, 0, ctrlKey, altKey, shiftKey, met aKey, 0, nullptr, 65 pageLocation.x(), pageLocation.y(), 0, 0, ctrlKey, altKey, shiftKey, met aKey, 0, buttons,
66 nullptr, false, PlatformMouseEvent::RealOrIndistinguishable) 66 nullptr, nullptr, false, PlatformMouseEvent::RealOrIndistinguishable)
67 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl ier) 67 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl ier)
68 , m_deltaX(-rawDelta.x()) 68 , m_deltaX(-rawDelta.x())
69 , m_deltaY(-rawDelta.y()) 69 , m_deltaY(-rawDelta.y())
70 , m_deltaZ(0) 70 , m_deltaZ(0)
71 , m_deltaMode(deltaMode) 71 , m_deltaMode(deltaMode)
72 { 72 {
73 } 73 }
74 74
75 const AtomicString& WheelEvent::interfaceName() const 75 const AtomicString& WheelEvent::interfaceName() const
76 { 76 {
(...skipping 22 matching lines...) Expand all
99 99
100 PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> WheelEventDispatchMediator::c reate(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view ) 100 PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> WheelEventDispatchMediator::c reate(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view )
101 { 101 {
102 return adoptRefWillBeNoop(new WheelEventDispatchMediator(event, view)); 102 return adoptRefWillBeNoop(new WheelEventDispatchMediator(event, view));
103 } 103 }
104 104
105 WheelEventDispatchMediator::WheelEventDispatchMediator(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view) 105 WheelEventDispatchMediator::WheelEventDispatchMediator(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view)
106 { 106 {
107 setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicks Y()), FloatPoint(event.deltaX(), event.deltaY()), 107 setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicks Y()), FloatPoint(event.deltaX(), event.deltaY()),
108 deltaMode(event), view, event.globalPosition(), event.position(), 108 deltaMode(event), view, event.globalPosition(), event.position(),
109 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey())); 109 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
110 MouseEvent::platformModifiersToButtons(event.modifiers())));
110 } 111 }
111 112
112 WheelEvent& WheelEventDispatchMediator::event() const 113 WheelEvent& WheelEventDispatchMediator::event() const
113 { 114 {
114 return toWheelEvent(EventDispatchMediator::event()); 115 return toWheelEvent(EventDispatchMediator::event());
115 } 116 }
116 117
117 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons t 118 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons t
118 { 119 {
119 if (!(event().deltaX() || event().deltaY())) 120 if (!(event().deltaX() || event().deltaY()))
120 return true; 121 return true;
121 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled(); 122 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled();
122 } 123 }
123 124
124 } // namespace blink 125 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/events/WheelEvent.h ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698