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

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

Issue 16114003: Don't send touch move to renderer while scrolling (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase/switch to model of "no-touch-while-scrolling & touch-end after scrolling stops" Created 7 years, 4 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_IMMEDIATE_INPUT_ROUTER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
65 65
66 GestureEventFilter* gesture_event_filter() { 66 GestureEventFilter* gesture_event_filter() {
67 return gesture_event_filter_.get(); 67 return gesture_event_filter_.get();
68 } 68 }
69 69
70 TouchEventQueue* touch_event_queue() { 70 TouchEventQueue* touch_event_queue() {
71 return touch_event_queue_.get(); 71 return touch_event_queue_.get();
72 } 72 }
73 73
74 bool no_touch_to_renderer_while_scrolling() const {
75 return no_touch_to_renderer_while_scrolling_;
76 }
77
74 private: 78 private:
75 // TouchEventQueueClient 79 // TouchEventQueueClient
76 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, 80 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event,
77 InputEventAckState ack_result) OVERRIDE; 81 InputEventAckState ack_result) OVERRIDE;
78 82
79 bool SendMoveCaret(IPC::Message* message); 83 bool SendMoveCaret(IPC::Message* message);
80 bool SendSelectRange(IPC::Message* message); 84 bool SendSelectRange(IPC::Message* message);
81 bool Send(IPC::Message* message); 85 bool Send(IPC::Message* message);
82 86
83 // Transmits the given input event an as an IPC::Message. This is an internal 87 // Transmits the given input event an as an IPC::Message. This is an internal
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Called by ProcessInputEventAck() to process a gesture event ack message. 120 // Called by ProcessInputEventAck() to process a gesture event ack message.
117 // This validates the gesture for suppression of touchpad taps and sends one 121 // This validates the gesture for suppression of touchpad taps and sends one
118 // previously queued coalesced gesture if it exists. 122 // previously queued coalesced gesture if it exists.
119 void ProcessGestureAck(int type, InputEventAckState ack_result); 123 void ProcessGestureAck(int type, InputEventAckState ack_result);
120 124
121 // Called on ProcessInputEventAck() to process a touch event ack message. 125 // Called on ProcessInputEventAck() to process a touch event ack message.
122 // This can result in a gesture event being generated and sent back to the 126 // This can result in a gesture event being generated and sent back to the
123 // renderer. 127 // renderer.
124 void ProcessTouchAck(InputEventAckState ack_result); 128 void ProcessTouchAck(InputEventAckState ack_result);
125 129
130 void HandleGestureScroll(
sadrul 2013/08/06 19:34:19 doc
131 const GestureEventWithLatencyInfo& gesture_event);
132
126 int routing_id() const { return routing_id_; } 133 int routing_id() const { return routing_id_; }
127 134
128 135
129 RenderProcessHost* process_; 136 RenderProcessHost* process_;
130 InputRouterClient* client_; 137 InputRouterClient* client_;
131 int routing_id_; 138 int routing_id_;
132 139
133 // (Similar to |mouse_move_pending_|.) True while waiting for SelectRange_ACK. 140 // (Similar to |mouse_move_pending_|.) True while waiting for SelectRange_ACK.
134 bool select_range_pending_; 141 bool select_range_pending_;
135 142
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // A queue of keyboard events. We can't trust data from the renderer so we 182 // A queue of keyboard events. We can't trust data from the renderer so we
176 // stuff key events into a queue and pop them out on ACK, feeding our copy 183 // stuff key events into a queue and pop them out on ACK, feeding our copy
177 // back to whatever unhandled handler instead of the returned version. 184 // back to whatever unhandled handler instead of the returned version.
178 KeyQueue key_queue_; 185 KeyQueue key_queue_;
179 186
180 // Keeps track of whether the webpage has any touch event handler. If it does, 187 // Keeps track of whether the webpage has any touch event handler. If it does,
181 // then touch events are sent to the renderer. Otherwise, the touch events are 188 // then touch events are sent to the renderer. Otherwise, the touch events are
182 // not sent to the renderer. 189 // not sent to the renderer.
183 bool has_touch_handler_; 190 bool has_touch_handler_;
184 191
192 // If scrolling is in progress, |no_touch_to_renderer_while_scrolling_| is set
193 // to be true and no touch event is sent to renderer.
194 bool no_touch_to_renderer_while_scrolling_;
195
185 scoped_ptr<TouchEventQueue> touch_event_queue_; 196 scoped_ptr<TouchEventQueue> touch_event_queue_;
186 scoped_ptr<GestureEventFilter> gesture_event_filter_; 197 scoped_ptr<GestureEventFilter> gesture_event_filter_;
187 198
188 DISALLOW_COPY_AND_ASSIGN(ImmediateInputRouter); 199 DISALLOW_COPY_AND_ASSIGN(ImmediateInputRouter);
189 }; 200 };
190 201
191 } // namespace content 202 } // namespace content
192 203
193 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ 204 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698