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

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

Issue 197213011: Selectively disable rubber banding on mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update the behavior to be correct. :D Created 6 years, 9 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) 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 , m_wheelTicksY(0) 66 , m_wheelTicksY(0)
67 , m_granularity(ScrollByPixelWheelEvent) 67 , m_granularity(ScrollByPixelWheelEvent)
68 , m_directionInvertedFromDevice(false) 68 , m_directionInvertedFromDevice(false)
69 , m_hasPreciseScrollingDeltas(false) 69 , m_hasPreciseScrollingDeltas(false)
70 #if OS(MACOSX) 70 #if OS(MACOSX)
71 , m_phase(PlatformWheelEventPhaseNone) 71 , m_phase(PlatformWheelEventPhaseNone)
72 , m_momentumPhase(PlatformWheelEventPhaseNone) 72 , m_momentumPhase(PlatformWheelEventPhaseNone)
73 , m_scrollCount(0) 73 , m_scrollCount(0)
74 , m_unacceleratedScrollingDeltaX(0) 74 , m_unacceleratedScrollingDeltaX(0)
75 , m_unacceleratedScrollingDeltaY(0) 75 , m_unacceleratedScrollingDeltaY(0)
76 , m_canRubberbandLeft(true)
77 , m_canRubberbandRight(true)
76 #endif 78 #endif
77 { 79 {
78 } 80 }
79 81
80 PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranulari ty granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey) 82 PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranulari ty granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
81 : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey , 0) 83 : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey , 0)
82 , m_position(position) 84 , m_position(position)
83 , m_globalPosition(globalPosition) 85 , m_globalPosition(globalPosition)
84 , m_deltaX(deltaX) 86 , m_deltaX(deltaX)
85 , m_deltaY(deltaY) 87 , m_deltaY(deltaY)
86 , m_wheelTicksX(wheelTicksX) 88 , m_wheelTicksX(wheelTicksX)
87 , m_wheelTicksY(wheelTicksY) 89 , m_wheelTicksY(wheelTicksY)
88 , m_granularity(granularity) 90 , m_granularity(granularity)
89 , m_directionInvertedFromDevice(false) 91 , m_directionInvertedFromDevice(false)
90 , m_hasPreciseScrollingDeltas(false) 92 , m_hasPreciseScrollingDeltas(false)
91 #if OS(MACOSX) 93 #if OS(MACOSX)
92 , m_phase(PlatformWheelEventPhaseNone) 94 , m_phase(PlatformWheelEventPhaseNone)
93 , m_momentumPhase(PlatformWheelEventPhaseNone) 95 , m_momentumPhase(PlatformWheelEventPhaseNone)
94 , m_scrollCount(0) 96 , m_scrollCount(0)
95 , m_unacceleratedScrollingDeltaX(0) 97 , m_unacceleratedScrollingDeltaX(0)
96 , m_unacceleratedScrollingDeltaY(0) 98 , m_unacceleratedScrollingDeltaY(0)
99 , m_canRubberbandLeft(true)
100 , m_canRubberbandRight(true)
97 #endif 101 #endif
98 { 102 {
99 } 103 }
100 104
101 PlatformWheelEvent copyTurningVerticalTicksIntoHorizontalTicks() const 105 PlatformWheelEvent copyTurningVerticalTicksIntoHorizontalTicks() const
102 { 106 {
103 PlatformWheelEvent copy = *this; 107 PlatformWheelEvent copy = *this;
104 108
105 copy.m_deltaX = copy.m_deltaY; 109 copy.m_deltaX = copy.m_deltaY;
106 copy.m_deltaY = 0; 110 copy.m_deltaY = 0;
(...skipping 18 matching lines...) Expand all
125 129
126 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; } 130 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
127 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; } 131 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; }
128 #if OS(MACOSX) 132 #if OS(MACOSX)
129 PlatformWheelEventPhase phase() const { return m_phase; } 133 PlatformWheelEventPhase phase() const { return m_phase; }
130 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; } 134 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
131 unsigned scrollCount() const { return m_scrollCount; } 135 unsigned scrollCount() const { return m_scrollCount; }
132 float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrolling DeltaX; } 136 float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrolling DeltaX; }
133 float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrolling DeltaY; } 137 float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrolling DeltaY; }
134 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; } 138 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; }
139 bool canRubberbandLeft() const { return m_canRubberbandLeft; }
140 bool canRubberbandRight() const { return m_canRubberbandRight; }
135 #else 141 #else
136 bool useLatchedEventNode() const { return false; } 142 bool useLatchedEventNode() const { return false; }
137 #endif 143 #endif
138 144
139 protected: 145 protected:
140 IntPoint m_position; 146 IntPoint m_position;
141 IntPoint m_globalPosition; 147 IntPoint m_globalPosition;
142 float m_deltaX; 148 float m_deltaX;
143 float m_deltaY; 149 float m_deltaY;
144 float m_wheelTicksX; 150 float m_wheelTicksX;
145 float m_wheelTicksY; 151 float m_wheelTicksY;
146 PlatformWheelEventGranularity m_granularity; 152 PlatformWheelEventGranularity m_granularity;
147 bool m_directionInvertedFromDevice; 153 bool m_directionInvertedFromDevice;
148 bool m_hasPreciseScrollingDeltas; 154 bool m_hasPreciseScrollingDeltas;
149 #if OS(MACOSX) 155 #if OS(MACOSX)
150 PlatformWheelEventPhase m_phase; 156 PlatformWheelEventPhase m_phase;
151 PlatformWheelEventPhase m_momentumPhase; 157 PlatformWheelEventPhase m_momentumPhase;
152 unsigned m_scrollCount; 158 unsigned m_scrollCount;
153 float m_unacceleratedScrollingDeltaX; 159 float m_unacceleratedScrollingDeltaX;
154 float m_unacceleratedScrollingDeltaY; 160 float m_unacceleratedScrollingDeltaY;
161 bool m_canRubberbandLeft;
162 bool m_canRubberbandRight;
155 #endif 163 #endif
156 }; 164 };
157 165
158 } // namespace WebCore 166 } // namespace WebCore
159 167
160 #endif // PlatformWheelEvent_h 168 #endif // PlatformWheelEvent_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/mac/ScrollElasticityController.h » ('j') | Source/platform/mac/ScrollElasticityController.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698