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

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

Issue 133133006: Update Event classes to use OVERRIDE / FINAL when needed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/core/events/WebKitAnimationEvent.h ('k') | no next file » | 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, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv ed.
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 26 matching lines...) Expand all
37 WheelEventInit(); 37 WheelEventInit();
38 38
39 double deltaX; 39 double deltaX;
40 double deltaY; 40 double deltaY;
41 double deltaZ; 41 double deltaZ;
42 int wheelDeltaX; // Deprecated. 42 int wheelDeltaX; // Deprecated.
43 int wheelDeltaY; // Deprecated. 43 int wheelDeltaY; // Deprecated.
44 unsigned deltaMode; 44 unsigned deltaMode;
45 }; 45 };
46 46
47 class WheelEvent : public MouseEvent { 47 class WheelEvent FINAL : public MouseEvent {
48 public: 48 public:
49 enum { TickMultiplier = 120 }; 49 enum { TickMultiplier = 120 };
50 50
51 enum DeltaMode { 51 enum DeltaMode {
52 DOM_DELTA_PIXEL = 0, 52 DOM_DELTA_PIXEL = 0,
53 DOM_DELTA_LINE, 53 DOM_DELTA_LINE,
54 DOM_DELTA_PAGE 54 DOM_DELTA_PAGE
55 }; 55 };
56 56
57 static PassRefPtr<WheelEvent> create() 57 static PassRefPtr<WheelEvent> create()
(...skipping 28 matching lines...) Expand all
86 double deltaZ() const { return m_deltaZ; } 86 double deltaZ() const { return m_deltaZ; }
87 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX( ); } // Deprecated. 87 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX( ); } // Deprecated.
88 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative when scrolling right. 88 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative when scrolling right.
89 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative when scrolling down. 89 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative when scrolling down.
90 unsigned deltaMode() const { return m_deltaMode; } 90 unsigned deltaMode() const { return m_deltaMode; }
91 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul tiplier; } 91 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul tiplier; }
92 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul tiplier; } 92 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul tiplier; }
93 93
94 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedF romDevice; } 94 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedF romDevice; }
95 95
96 virtual const AtomicString& interfaceName() const; 96 virtual const AtomicString& interfaceName() const OVERRIDE;
97 virtual bool isMouseEvent() const OVERRIDE; 97 virtual bool isMouseEvent() const OVERRIDE;
98 virtual bool isWheelEvent() const OVERRIDE; 98 virtual bool isWheelEvent() const OVERRIDE;
99 99
100 private: 100 private:
101 WheelEvent(); 101 WheelEvent();
102 WheelEvent(const AtomicString&, const WheelEventInit&); 102 WheelEvent(const AtomicString&, const WheelEventInit&);
103 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, 103 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
104 unsigned, PassRefPtr<AbstractView>, const IntPoint& screenLocation, cons t IntPoint& pageLocation, 104 unsigned, PassRefPtr<AbstractView>, const IntPoint& screenLocation, cons t IntPoint& pageLocation,
105 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionIn vertedFromDevice); 105 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionIn vertedFromDevice);
106 106
107 IntPoint m_wheelDelta; 107 IntPoint m_wheelDelta;
108 double m_deltaX; 108 double m_deltaX;
109 double m_deltaY; 109 double m_deltaY;
110 double m_deltaZ; 110 double m_deltaZ;
111 unsigned m_deltaMode; 111 unsigned m_deltaMode;
112 bool m_directionInvertedFromDevice; 112 bool m_directionInvertedFromDevice;
113 }; 113 };
114 114
115 DEFINE_EVENT_TYPE_CASTS(WheelEvent); 115 DEFINE_EVENT_TYPE_CASTS(WheelEvent);
116 116
117 class WheelEventDispatchMediator : public EventDispatchMediator { 117 class WheelEventDispatchMediator FINAL : public EventDispatchMediator {
118 public: 118 public:
119 static PassRefPtr<WheelEventDispatchMediator> create(const PlatformWheelEven t&, PassRefPtr<AbstractView>); 119 static PassRefPtr<WheelEventDispatchMediator> create(const PlatformWheelEven t&, PassRefPtr<AbstractView>);
120 private: 120 private:
121 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtr<AbstractVie w>); 121 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtr<AbstractVie w>);
122 WheelEvent* event() const; 122 WheelEvent* event() const;
123 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; 123 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
124 }; 124 };
125 125
126 } // namespace WebCore 126 } // namespace WebCore
127 127
128 #endif // WheelEvent_h 128 #endif // WheelEvent_h
OLDNEW
« no previous file with comments | « Source/core/events/WebKitAnimationEvent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698