| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 bool has_pending() const WARN_UNUSED_RESULT { | 68 bool has_pending() const WARN_UNUSED_RESULT { |
| 69 return !wheel_queue_.empty() || event_sent_for_gesture_ack_; | 69 return !wheel_queue_.empty() || event_sent_for_gesture_ack_; |
| 70 } | 70 } |
| 71 | 71 |
| 72 size_t queued_size() const { return wheel_queue_.size(); } | 72 size_t queued_size() const { return wheel_queue_.size(); } |
| 73 bool event_in_flight() const { return event_sent_for_gesture_ack_; } | 73 bool event_in_flight() const { return event_sent_for_gesture_ack_; } |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 void TryForwardNextEventToRenderer(); | 76 void TryForwardNextEventToRenderer(); |
| 77 void SendScrollEnd(); | 77 void SendScrollEnd(blink::WebGestureEvent::ScrollUnits units); |
| 78 void SendGesture(const GestureEventWithLatencyInfo& gesture); | 78 void SendGesture(const GestureEventWithLatencyInfo& gesture); |
| 79 | 79 |
| 80 MouseWheelEventQueueClient* client_; | 80 MouseWheelEventQueueClient* client_; |
| 81 bool needs_scroll_begin_; | 81 bool needs_scroll_begin_; |
| 82 base::OneShotTimer scroll_end_timer_; | 82 base::OneShotTimer scroll_end_timer_; |
| 83 | 83 |
| 84 typedef std::deque<QueuedWebMouseWheelEvent*> WheelEventQueue; | 84 typedef std::deque<QueuedWebMouseWheelEvent*> WheelEventQueue; |
| 85 WheelEventQueue wheel_queue_; | 85 WheelEventQueue wheel_queue_; |
| 86 scoped_ptr<QueuedWebMouseWheelEvent> event_sent_for_gesture_ack_; | 86 scoped_ptr<QueuedWebMouseWheelEvent> event_sent_for_gesture_ack_; |
| 87 bool send_gestures_; | 87 bool send_gestures_; |
| 88 int64_t scroll_transaction_ms_; | 88 int64_t scroll_transaction_ms_; |
| 89 blink::WebGestureDevice scrolling_device_; | 89 blink::WebGestureDevice scrolling_device_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(MouseWheelEventQueue); | 91 DISALLOW_COPY_AND_ASSIGN(MouseWheelEventQueue); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace content | 94 } // namespace content |
| 95 | 95 |
| 96 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ | 96 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOUSE_WHEEL_EVENT_QUEUE_H_ |
| OLD | NEW |