Chromium Code Reviews| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 return !wheel_queue_.empty() || event_sent_for_gesture_ack_; | 73 return !wheel_queue_.empty() || event_sent_for_gesture_ack_; |
| 74 } | 74 } |
| 75 | 75 |
| 76 size_t queued_size() const { return wheel_queue_.size(); } | 76 size_t queued_size() const { return wheel_queue_.size(); } |
| 77 bool event_in_flight() const { | 77 bool event_in_flight() const { |
| 78 return event_sent_for_gesture_ack_ != nullptr; | 78 return event_sent_for_gesture_ack_ != nullptr; |
| 79 } | 79 } |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 void TryForwardNextEventToRenderer(); | 82 void TryForwardNextEventToRenderer(); |
| 83 void SendScrollEnd(blink::WebGestureEvent update_event, bool synthetic); | 83 void SendScrollEnd(blink::WebGestureEvent update_event, |
| 84 bool synthetic, | |
| 85 bool fling_might_happen_next); | |
|
tdresser
2016/11/14 16:02:29
Can we be consistent, and call this may_precede_fl
sahel
2016/11/18 16:13:58
Done.
| |
| 84 void SendScrollBegin(const blink::WebGestureEvent& gesture_update, | 86 void SendScrollBegin(const blink::WebGestureEvent& gesture_update, |
| 85 bool synthetic); | 87 bool synthetic); |
| 86 | 88 |
| 87 MouseWheelEventQueueClient* client_; | 89 MouseWheelEventQueueClient* client_; |
| 88 base::OneShotTimer scroll_end_timer_; | 90 base::OneShotTimer scroll_end_timer_; |
| 89 | 91 |
| 90 std::deque<std::unique_ptr<QueuedWebMouseWheelEvent>> wheel_queue_; | 92 std::deque<std::unique_ptr<QueuedWebMouseWheelEvent>> wheel_queue_; |
| 91 std::unique_ptr<QueuedWebMouseWheelEvent> event_sent_for_gesture_ack_; | 93 std::unique_ptr<QueuedWebMouseWheelEvent> event_sent_for_gesture_ack_; |
| 92 | 94 |
| 93 // True if a non-synthetic GSB needs to be sent before a GSU is sent. | 95 // True if a non-synthetic GSB needs to be sent before a GSU is sent. |
| 94 bool needs_scroll_begin_; | 96 bool needs_scroll_begin_; |
| 95 | 97 |
| 96 // True if a non-synthetic GSE needs to be sent because a non-synthetic | 98 // True if a non-synthetic GSE needs to be sent because a non-synthetic |
| 97 // GSB has been sent in the past. | 99 // GSB has been sent in the past. |
| 98 bool needs_scroll_end_; | 100 bool needs_scroll_end_; |
| 99 | 101 |
| 100 // True if the touchpad and wheel scroll latching is enabled. | 102 // True if the touchpad and wheel scroll latching is enabled. |
| 101 bool enable_scroll_latching_; | 103 bool enable_scroll_latching_; |
| 102 | 104 |
| 103 int64_t scroll_transaction_ms_; | 105 int64_t scroll_transaction_ms_; |
| 104 blink::WebGestureDevice scrolling_device_; | 106 blink::WebGestureDevice scrolling_device_; |
| 105 | 107 |
| 108 blink::WebGestureEvent last_scroll_update_; | |
| 109 | |
| 106 DISALLOW_COPY_AND_ASSIGN(MouseWheelEventQueue); | 110 DISALLOW_COPY_AND_ASSIGN(MouseWheelEventQueue); |
| 107 }; | 111 }; |
| 108 | 112 |
| 109 } // namespace content | 113 } // namespace content |
| 110 | 114 |
| 111 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ | 115 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ |
| OLD | NEW |