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 CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 public: | 30 public: |
31 virtual ~MouseWheelEventQueueClient() {} | 31 virtual ~MouseWheelEventQueueClient() {} |
32 | 32 |
33 virtual void SendMouseWheelEventImmediately( | 33 virtual void SendMouseWheelEventImmediately( |
34 const MouseWheelEventWithLatencyInfo& event) = 0; | 34 const MouseWheelEventWithLatencyInfo& event) = 0; |
35 virtual void ForwardGestureEventWithLatencyInfo( | 35 virtual void ForwardGestureEventWithLatencyInfo( |
36 const blink::WebGestureEvent& event, | 36 const blink::WebGestureEvent& event, |
37 const ui::LatencyInfo& latency_info) = 0; | 37 const ui::LatencyInfo& latency_info) = 0; |
38 virtual void OnMouseWheelEventAck(const MouseWheelEventWithLatencyInfo& event, | 38 virtual void OnMouseWheelEventAck(const MouseWheelEventWithLatencyInfo& event, |
39 InputEventAckState ack_result) = 0; | 39 InputEventAckState ack_result) = 0; |
| 40 virtual bool is_in_gesture_scroll() = 0; |
40 }; | 41 }; |
41 | 42 |
42 // A queue for throttling and coalescing mouse wheel events. | 43 // A queue for throttling and coalescing mouse wheel events. |
43 class CONTENT_EXPORT MouseWheelEventQueue { | 44 class CONTENT_EXPORT MouseWheelEventQueue { |
44 public: | 45 public: |
45 // The |client| must outlive the MouseWheelEventQueue. |send_gestures| | 46 // The |client| must outlive the MouseWheelEventQueue. |send_gestures| |
46 // indicates whether mouse wheel events should generate | 47 // indicates whether mouse wheel events should generate |
47 // Scroll[Begin|Update|End] on unhandled acknowledge events. | 48 // Scroll[Begin|Update|End] on unhandled acknowledge events. |
48 // |scroll_transaction_ms| is the duration in which the | 49 // |scroll_transaction_ms| is the duration in which the |
49 // ScrollEnd should be sent after a ScrollUpdate. | 50 // ScrollEnd should be sent after a ScrollUpdate. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void SendScrollEnd(blink::WebGestureEvent update_event, bool synthetic); | 84 void SendScrollEnd(blink::WebGestureEvent update_event, bool synthetic); |
84 void SendScrollBegin(const blink::WebGestureEvent& gesture_update, | 85 void SendScrollBegin(const blink::WebGestureEvent& gesture_update, |
85 bool synthetic); | 86 bool synthetic); |
86 | 87 |
87 MouseWheelEventQueueClient* client_; | 88 MouseWheelEventQueueClient* client_; |
88 base::OneShotTimer scroll_end_timer_; | 89 base::OneShotTimer scroll_end_timer_; |
89 | 90 |
90 std::deque<std::unique_ptr<QueuedWebMouseWheelEvent>> wheel_queue_; | 91 std::deque<std::unique_ptr<QueuedWebMouseWheelEvent>> wheel_queue_; |
91 std::unique_ptr<QueuedWebMouseWheelEvent> event_sent_for_gesture_ack_; | 92 std::unique_ptr<QueuedWebMouseWheelEvent> event_sent_for_gesture_ack_; |
92 | 93 |
93 // True if a non-synthetic GSB needs to be sent before a GSU is sent. | |
94 bool needs_scroll_begin_; | |
95 | |
96 // True if a non-synthetic GSE needs to be sent because a non-synthetic | |
97 // GSB has been sent in the past. | |
98 bool needs_scroll_end_; | |
99 | |
100 // True if the touchpad and wheel scroll latching is enabled. | 94 // True if the touchpad and wheel scroll latching is enabled. |
101 bool enable_scroll_latching_; | 95 bool enable_scroll_latching_; |
102 | 96 |
103 int64_t scroll_transaction_ms_; | 97 int64_t scroll_transaction_ms_; |
104 blink::WebGestureDevice scrolling_device_; | 98 blink::WebGestureDevice scrolling_device_; |
105 | 99 |
106 DISALLOW_COPY_AND_ASSIGN(MouseWheelEventQueue); | 100 DISALLOW_COPY_AND_ASSIGN(MouseWheelEventQueue); |
107 }; | 101 }; |
108 | 102 |
109 } // namespace content | 103 } // namespace content |
110 | 104 |
111 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ | 105 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ |
OLD | NEW |