OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WebScrollStateData_h | |
6 #define WebScrollStateData_h | |
7 | |
8 #include "WebCommon.h" | |
9 | |
10 #include <deque> | |
11 | |
12 namespace blink { | |
13 | |
14 // WebScrollState data contains the data used by blink::ScrollState. This is | |
15 // used by the scroll customization API, detailed here (https://goo.gl/1ipTpP). | |
16 // For the cc equivalent, see cc::ScrollStateData and cc::ScrollState. | |
17 struct BLINK_EXPORT WebScrollStateData { | |
18 WebScrollStateData(double deltaX, double deltaY, double deltaGranularity, | |
19 double velocityX, double velocityY, bool inInertialPhase, | |
20 bool isBeginning = false, bool isEnding = false, | |
21 bool fromUserInput = false, bool shouldPropagate = true, | |
22 bool deltaConsumedForScrollSequence = false) | |
23 : deltaX(deltaX) | |
24 , deltaY(deltaY) | |
25 , deltaGranularity(deltaGranularity) | |
26 , velocityX(velocityX) | |
27 , velocityY(velocityY) | |
28 , inInertialPhase(inInertialPhase) | |
29 , isBeginning(isBeginning) | |
30 , isEnding(isEnding) | |
31 , fromUserInput(fromUserInput) | |
32 , shouldPropagate(shouldPropagate) | |
33 , currentNativeScrollingElement(0) | |
34 , deltaConsumedForScrollSequence(deltaConsumedForScrollSequence) | |
35 , causedScrollX(false) | |
36 , causedScrollY(false) | |
37 { | |
38 } | |
39 | |
40 WebScrollStateData() | |
41 : WebScrollStateData(0, 0, 0, 0, 0, false) | |
42 { | |
43 } | |
44 | |
45 double deltaX; | |
46 double deltaY; | |
47 double deltaGranularity; | |
48 double velocityX; | |
49 double velocityY; | |
50 bool inInertialPhase; | |
51 bool isBeginning; | |
52 bool isEnding; | |
53 | |
54 bool fromUserInput; | |
55 bool shouldPropagate; | |
56 // The id of the last native element to respond to a scroll, or 0 if none ex
ists. | |
57 int currentNativeScrollingElement; | |
58 // Whether the scroll sequence has had any delta consumed, in the | |
59 // current frame, or any child frames. | |
60 bool deltaConsumedForScrollSequence; | |
61 | |
62 bool causedScrollX; | |
63 bool causedScrollY; | |
64 }; | |
65 | |
66 } // namespace blink | |
67 | |
68 #endif // WebScrollStateData_h | |
OLD | NEW |