| 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 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // A queue for throttling and coalescing mouse wheel events. | 41 // A queue for throttling and coalescing mouse wheel events. |
| 42 class CONTENT_EXPORT MouseWheelEventQueue { | 42 class CONTENT_EXPORT MouseWheelEventQueue { |
| 43 public: | 43 public: |
| 44 // The |client| must outlive the MouseWheelEventQueue. |send_gestures| | 44 // The |client| must outlive the MouseWheelEventQueue. |send_gestures| |
| 45 // indicates whether mouse wheel events should generate | 45 // indicates whether mouse wheel events should generate |
| 46 // Scroll[Begin|Update|End] on unhandled acknowledge events. | 46 // Scroll[Begin|Update|End] on unhandled acknowledge events. |
| 47 // |scroll_transaction_ms| is the duration in which the | 47 // |scroll_transaction_ms| is the duration in which the |
| 48 // ScrollEnd should be sent after a ScrollUpdate. | 48 // ScrollEnd should be sent after a ScrollUpdate. |
| 49 MouseWheelEventQueue(MouseWheelEventQueueClient* client, | 49 MouseWheelEventQueue(MouseWheelEventQueueClient* client, |
| 50 bool send_gestures, |
| 50 int64_t scroll_transaction_ms); | 51 int64_t scroll_transaction_ms); |
| 51 | 52 |
| 52 ~MouseWheelEventQueue(); | 53 ~MouseWheelEventQueue(); |
| 53 | 54 |
| 54 // Adds an event to the queue. The event may be coalesced with previously | 55 // Adds an event to the queue. The event may be coalesced with previously |
| 55 // queued events (e.g. consecutive mouse-wheel events can be coalesced into a | 56 // queued events (e.g. consecutive mouse-wheel events can be coalesced into a |
| 56 // single mouse-wheel event). The event may also be immediately forwarded to | 57 // single mouse-wheel event). The event may also be immediately forwarded to |
| 57 // the renderer (e.g. when there are no other queued mouse-wheel event). | 58 // the renderer (e.g. when there are no other queued mouse-wheel event). |
| 58 void QueueEvent(const MouseWheelEventWithLatencyInfo& event); | 59 void QueueEvent(const MouseWheelEventWithLatencyInfo& event); |
| 59 | 60 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 90 WheelEventQueue wheel_queue_; | 91 WheelEventQueue 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 // True if a non-synthetic GSB needs to be sent before a GSU is sent. |
| 94 bool needs_scroll_begin_; | 95 bool needs_scroll_begin_; |
| 95 | 96 |
| 96 // True if a non-synthetic GSE needs to be sent because a non-synthetic | 97 // True if a non-synthetic GSE needs to be sent because a non-synthetic |
| 97 // GSB has been sent in the past. | 98 // GSB has been sent in the past. |
| 98 bool needs_scroll_end_; | 99 bool needs_scroll_end_; |
| 99 | 100 |
| 101 bool send_gestures_; |
| 100 int64_t scroll_transaction_ms_; | 102 int64_t scroll_transaction_ms_; |
| 101 blink::WebGestureDevice scrolling_device_; | 103 blink::WebGestureDevice scrolling_device_; |
| 102 | 104 |
| 103 DISALLOW_COPY_AND_ASSIGN(MouseWheelEventQueue); | 105 DISALLOW_COPY_AND_ASSIGN(MouseWheelEventQueue); |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 } // namespace content | 108 } // namespace content |
| 107 | 109 |
| 108 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ | 110 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ |
| OLD | NEW |