Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: content/browser/renderer_host/input/mouse_wheel_event_queue.h

Issue 1749343004: Implement Wheel Gesture Scrolling on OSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix non mac builds Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(blink::WebGestureEvent update_event); 77 void SendScrollEnd(blink::WebGestureEvent update_event);
78 void SendGesture(const GestureEventWithLatencyInfo& gesture); 78 void SendGesture(const GestureEventWithLatencyInfo& gesture, bool needs_end);
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698