OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebMouseWheelEvent_h | 5 #ifndef WebMouseWheelEvent_h |
6 #define WebMouseWheelEvent_h | 6 #define WebMouseWheelEvent_h |
7 | 7 |
8 #include "WebMouseEvent.h" | 8 #include "WebMouseEvent.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 RailsMode rails_mode; | 50 RailsMode rails_mode; |
51 | 51 |
52 // Whether the event is blocking, non-blocking, all event | 52 // Whether the event is blocking, non-blocking, all event |
53 // listeners were passive or was forced to be non-blocking. | 53 // listeners were passive or was forced to be non-blocking. |
54 DispatchType dispatch_type; | 54 DispatchType dispatch_type; |
55 | 55 |
56 WebMouseWheelEvent(Type type, int modifiers, double time_stamp_seconds) | 56 WebMouseWheelEvent(Type type, int modifiers, double time_stamp_seconds) |
57 : WebMouseEvent(sizeof(WebMouseWheelEvent), | 57 : WebMouseEvent(sizeof(WebMouseWheelEvent), |
58 type, | 58 type, |
59 modifiers, | 59 modifiers, |
60 time_stamp_seconds), | 60 time_stamp_seconds, |
| 61 kDefaultMousePointerId), |
61 delta_x(0.0f), | 62 delta_x(0.0f), |
62 delta_y(0.0f), | 63 delta_y(0.0f), |
63 wheel_ticks_x(0.0f), | 64 wheel_ticks_x(0.0f), |
64 wheel_ticks_y(0.0f), | 65 wheel_ticks_y(0.0f), |
65 acceleration_ratio_x(1.0f), | 66 acceleration_ratio_x(1.0f), |
66 acceleration_ratio_y(1.0f), | 67 acceleration_ratio_y(1.0f), |
67 resending_plugin_id(-1), | 68 resending_plugin_id(-1), |
68 phase(kPhaseNone), | 69 phase(kPhaseNone), |
69 momentum_phase(kPhaseNone), | 70 momentum_phase(kPhaseNone), |
70 scroll_by_page(false), | 71 scroll_by_page(false), |
71 has_precise_scrolling_deltas(false), | 72 has_precise_scrolling_deltas(false), |
72 rails_mode(kRailsModeFree), | 73 rails_mode(kRailsModeFree), |
73 dispatch_type(kBlocking) {} | 74 dispatch_type(kBlocking) {} |
74 | 75 |
75 WebMouseWheelEvent() | 76 WebMouseWheelEvent() |
76 : WebMouseEvent(sizeof(WebMouseWheelEvent)), | 77 : WebMouseEvent(sizeof(WebMouseWheelEvent), kDefaultMousePointerId), |
77 delta_x(0.0f), | 78 delta_x(0.0f), |
78 delta_y(0.0f), | 79 delta_y(0.0f), |
79 wheel_ticks_x(0.0f), | 80 wheel_ticks_x(0.0f), |
80 wheel_ticks_y(0.0f), | 81 wheel_ticks_y(0.0f), |
81 acceleration_ratio_x(1.0f), | 82 acceleration_ratio_x(1.0f), |
82 acceleration_ratio_y(1.0f), | 83 acceleration_ratio_y(1.0f), |
83 resending_plugin_id(-1), | 84 resending_plugin_id(-1), |
84 phase(kPhaseNone), | 85 phase(kPhaseNone), |
85 momentum_phase(kPhaseNone), | 86 momentum_phase(kPhaseNone), |
86 rails_mode(kRailsModeFree), | 87 rails_mode(kRailsModeFree), |
87 dispatch_type(kBlocking) {} | 88 dispatch_type(kBlocking) {} |
88 | 89 |
89 #if INSIDE_BLINK | 90 #if INSIDE_BLINK |
90 BLINK_PLATFORM_EXPORT float DeltaXInRootFrame() const; | 91 BLINK_PLATFORM_EXPORT float DeltaXInRootFrame() const; |
91 BLINK_PLATFORM_EXPORT float DeltaYInRootFrame() const; | 92 BLINK_PLATFORM_EXPORT float DeltaYInRootFrame() const; |
92 | 93 |
93 // Sets any scaled values to be their computed values and sets |frameScale| | 94 // Sets any scaled values to be their computed values and sets |frameScale| |
94 // back to 1 and |translateX|, |translateY| back to 0. | 95 // back to 1 and |translateX|, |translateY| back to 0. |
95 BLINK_PLATFORM_EXPORT WebMouseWheelEvent FlattenTransform() const; | 96 BLINK_PLATFORM_EXPORT WebMouseWheelEvent FlattenTransform() const; |
96 | 97 |
97 bool IsCancelable() const { return dispatch_type == kBlocking; } | 98 bool IsCancelable() const { return dispatch_type == kBlocking; } |
98 #endif | 99 #endif |
99 }; | 100 }; |
100 #pragma pack(pop) | 101 #pragma pack(pop) |
101 | 102 |
102 } // namespace blink | 103 } // namespace blink |
103 | 104 |
104 #endif // WebMouseWheelEvent_h | 105 #endif // WebMouseWheelEvent_h |
OLD | NEW |