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

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

Issue 24312009: Properly forward queued touch events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test Created 7 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_TOUCH_EVENT_QUEUE_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 no_touch_move_to_renderer_ = value; 65 no_touch_move_to_renderer_ = value;
66 } 66 }
67 67
68 private: 68 private:
69 friend class MockRenderWidgetHost; 69 friend class MockRenderWidgetHost;
70 friend class ImmediateInputRouterTest; 70 friend class ImmediateInputRouterTest;
71 71
72 CONTENT_EXPORT size_t GetQueueSize() const; 72 CONTENT_EXPORT size_t GetQueueSize() const;
73 CONTENT_EXPORT const TouchEventWithLatencyInfo& GetLatestEvent() const; 73 CONTENT_EXPORT const TouchEventWithLatencyInfo& GetLatestEvent() const;
74 74
75 // Walks the queue, checking each event for |ShouldForwardToRenderer()|.
76 // If true, forwards the touch event and stops processing further events.
77 // If false, acks the event with |INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS|.
78 void TryForwardNextEventToRenderer();
79
75 // Pops the touch-event from the top of the queue and sends it to the 80 // Pops the touch-event from the top of the queue and sends it to the
76 // TouchEventQueueClient. This reduces the size of the queue by one. 81 // TouchEventQueueClient. This reduces the size of the queue by one.
77 void PopTouchEventToClient(InputEventAckState ack_result, 82 void PopTouchEventToClient(InputEventAckState ack_result,
78 const ui::LatencyInfo& renderer_latency_info); 83 const ui::LatencyInfo& renderer_latency_info);
79 84
80 bool ShouldForwardToRenderer(const WebKit::WebTouchEvent& event) const; 85 bool ShouldForwardToRenderer(const WebKit::WebTouchEvent& event) const;
81 86
82 // Handles touch event forwarding and ack'ed event dispatch. 87 // Handles touch event forwarding and ack'ed event dispatch.
83 TouchEventQueueClient* client_; 88 TouchEventQueueClient* client_;
84 89
(...skipping 11 matching lines...) Expand all
96 // is scrolling. This behaviour is currently enabled only on aura behind a 101 // is scrolling. This behaviour is currently enabled only on aura behind a
97 // flag. 102 // flag.
98 bool no_touch_move_to_renderer_; 103 bool no_touch_move_to_renderer_;
99 104
100 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); 105 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue);
101 }; 106 };
102 107
103 } // namespace content 108 } // namespace content
104 109
105 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ 110 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698