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

Side by Side Diff: Source/platform/PlatformWheelEvent.h

Issue 658953003: Remove redundant Mac event structures (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | Source/platform/mac/ScrollElasticityController.mm » ('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) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 : PlatformEvent(PlatformEvent::Wheel) 59 : PlatformEvent(PlatformEvent::Wheel)
60 , m_deltaX(0) 60 , m_deltaX(0)
61 , m_deltaY(0) 61 , m_deltaY(0)
62 , m_wheelTicksX(0) 62 , m_wheelTicksX(0)
63 , m_wheelTicksY(0) 63 , m_wheelTicksY(0)
64 , m_granularity(ScrollByPixelWheelEvent) 64 , m_granularity(ScrollByPixelWheelEvent)
65 , m_hasPreciseScrollingDeltas(false) 65 , m_hasPreciseScrollingDeltas(false)
66 #if OS(MACOSX) 66 #if OS(MACOSX)
67 , m_phase(PlatformWheelEventPhaseNone) 67 , m_phase(PlatformWheelEventPhaseNone)
68 , m_momentumPhase(PlatformWheelEventPhaseNone) 68 , m_momentumPhase(PlatformWheelEventPhaseNone)
69 , m_scrollCount(0)
70 , m_unacceleratedScrollingDeltaX(0)
71 , m_unacceleratedScrollingDeltaY(0)
72 , m_canRubberbandLeft(true) 69 , m_canRubberbandLeft(true)
73 , m_canRubberbandRight(true) 70 , m_canRubberbandRight(true)
74 #endif 71 #endif
75 { 72 {
76 } 73 }
77 74
78 PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranulari ty granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey) 75 PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranulari ty granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
79 : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey , 0) 76 : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey , 0)
80 , m_position(position) 77 , m_position(position)
81 , m_globalPosition(globalPosition) 78 , m_globalPosition(globalPosition)
82 , m_deltaX(deltaX) 79 , m_deltaX(deltaX)
83 , m_deltaY(deltaY) 80 , m_deltaY(deltaY)
84 , m_wheelTicksX(wheelTicksX) 81 , m_wheelTicksX(wheelTicksX)
85 , m_wheelTicksY(wheelTicksY) 82 , m_wheelTicksY(wheelTicksY)
86 , m_granularity(granularity) 83 , m_granularity(granularity)
87 , m_hasPreciseScrollingDeltas(false) 84 , m_hasPreciseScrollingDeltas(false)
88 #if OS(MACOSX) 85 #if OS(MACOSX)
89 , m_phase(PlatformWheelEventPhaseNone) 86 , m_phase(PlatformWheelEventPhaseNone)
90 , m_momentumPhase(PlatformWheelEventPhaseNone) 87 , m_momentumPhase(PlatformWheelEventPhaseNone)
91 , m_scrollCount(0)
92 , m_unacceleratedScrollingDeltaX(0)
93 , m_unacceleratedScrollingDeltaY(0)
94 , m_canRubberbandLeft(true) 88 , m_canRubberbandLeft(true)
95 , m_canRubberbandRight(true) 89 , m_canRubberbandRight(true)
96 #endif 90 #endif
97 { 91 {
98 } 92 }
99 93
100 const IntPoint& position() const { return m_position; } // PlatformWindow co ordinates. 94 const IntPoint& position() const { return m_position; } // PlatformWindow co ordinates.
101 const IntPoint& globalPosition() const { return m_globalPosition; } // Scree n coordinates. 95 const IntPoint& globalPosition() const { return m_globalPosition; } // Scree n coordinates.
102 96
103 float deltaX() const { return m_deltaX; } 97 float deltaX() const { return m_deltaX; }
104 float deltaY() const { return m_deltaY; } 98 float deltaY() const { return m_deltaY; }
105 99
106 float wheelTicksX() const { return m_wheelTicksX; } 100 float wheelTicksX() const { return m_wheelTicksX; }
107 float wheelTicksY() const { return m_wheelTicksY; } 101 float wheelTicksY() const { return m_wheelTicksY; }
108 102
109 PlatformWheelEventGranularity granularity() const { return m_granularity; } 103 PlatformWheelEventGranularity granularity() const { return m_granularity; }
110 104
111 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; } 105 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
112 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; } 106 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; }
113 #if OS(MACOSX) 107 #if OS(MACOSX)
114 PlatformWheelEventPhase phase() const { return m_phase; } 108 PlatformWheelEventPhase phase() const { return m_phase; }
115 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; } 109 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
116 unsigned scrollCount() const { return m_scrollCount; }
117 float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrolling DeltaX; }
118 float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrolling DeltaY; }
119 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; } 110 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; }
120 bool canRubberbandLeft() const { return m_canRubberbandLeft; } 111 bool canRubberbandLeft() const { return m_canRubberbandLeft; }
121 bool canRubberbandRight() const { return m_canRubberbandRight; } 112 bool canRubberbandRight() const { return m_canRubberbandRight; }
122 #else 113 #else
123 bool useLatchedEventNode() const { return false; } 114 bool useLatchedEventNode() const { return false; }
124 #endif 115 #endif
125 116
126 protected: 117 protected:
127 IntPoint m_position; 118 IntPoint m_position;
128 IntPoint m_globalPosition; 119 IntPoint m_globalPosition;
129 float m_deltaX; 120 float m_deltaX;
130 float m_deltaY; 121 float m_deltaY;
131 float m_wheelTicksX; 122 float m_wheelTicksX;
132 float m_wheelTicksY; 123 float m_wheelTicksY;
133 PlatformWheelEventGranularity m_granularity; 124 PlatformWheelEventGranularity m_granularity;
134 bool m_hasPreciseScrollingDeltas; 125 bool m_hasPreciseScrollingDeltas;
135 #if OS(MACOSX) 126 #if OS(MACOSX)
136 PlatformWheelEventPhase m_phase; 127 PlatformWheelEventPhase m_phase;
137 PlatformWheelEventPhase m_momentumPhase; 128 PlatformWheelEventPhase m_momentumPhase;
138 unsigned m_scrollCount;
139 float m_unacceleratedScrollingDeltaX;
140 float m_unacceleratedScrollingDeltaY;
141 bool m_canRubberbandLeft; 129 bool m_canRubberbandLeft;
142 bool m_canRubberbandRight; 130 bool m_canRubberbandRight;
143 #endif 131 #endif
144 }; 132 };
145 133
146 } // namespace blink 134 } // namespace blink
147 135
148 #endif // PlatformWheelEvent_h 136 #endif // PlatformWheelEvent_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/mac/ScrollElasticityController.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698