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

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

Issue 250923004: Synthesize ctrl-wheel events on touchpad pinch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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_INPUT_ROUTER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // Returns true if |input_event| was consumed by the client. 111 // Returns true if |input_event| was consumed by the client.
112 bool OfferToClient(const blink::WebInputEvent& input_event, 112 bool OfferToClient(const blink::WebInputEvent& input_event,
113 const ui::LatencyInfo& latency_info); 113 const ui::LatencyInfo& latency_info);
114 114
115 // Returns true if |input_event| was successfully sent to the renderer 115 // Returns true if |input_event| was successfully sent to the renderer
116 // as an async IPC Message. 116 // as an async IPC Message.
117 bool OfferToRenderer(const blink::WebInputEvent& input_event, 117 bool OfferToRenderer(const blink::WebInputEvent& input_event,
118 const ui::LatencyInfo& latency_info, 118 const ui::LatencyInfo& latency_info,
119 bool is_keyboard_shortcut); 119 bool is_keyboard_shortcut);
120 120
121 void SendSyntheticWheelEventForPinch(
122 const blink::WebGestureEvent& pinch_event,
123 const ui::LatencyInfo& latency_info);
124
121 // IPC message handlers 125 // IPC message handlers
122 void OnInputEventAck(blink::WebInputEvent::Type event_type, 126 void OnInputEventAck(blink::WebInputEvent::Type event_type,
123 InputEventAckState ack_result, 127 InputEventAckState ack_result,
124 const ui::LatencyInfo& latency_info); 128 const ui::LatencyInfo& latency_info);
125 void OnMsgMoveCaretAck(); 129 void OnMsgMoveCaretAck();
126 void OnSelectRangeAck(); 130 void OnSelectRangeAck();
127 void OnHasTouchEventHandlers(bool has_handlers); 131 void OnHasTouchEventHandlers(bool has_handlers);
128 void OnSetTouchAction(TouchAction touch_action); 132 void OnSetTouchAction(TouchAction touch_action);
129 133
130 // Indicates the source of an ack provided to |ProcessInputEventAck()|. 134 // Indicates the source of an ack provided to |ProcessInputEventAck()|.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 218
215 // The next mouse move event to send (only non-null while mouse_move_pending_ 219 // The next mouse move event to send (only non-null while mouse_move_pending_
216 // is true). 220 // is true).
217 scoped_ptr<MouseEventWithLatencyInfo> next_mouse_move_; 221 scoped_ptr<MouseEventWithLatencyInfo> next_mouse_move_;
218 222
219 // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent 223 // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent
220 // and we are waiting for a corresponding ack. 224 // and we are waiting for a corresponding ack.
221 bool mouse_wheel_pending_; 225 bool mouse_wheel_pending_;
222 MouseWheelEventWithLatencyInfo current_wheel_event_; 226 MouseWheelEventWithLatencyInfo current_wheel_event_;
223 227
228 // Whether there is a Touchpad GesturePinchUpdate currently pending, waiting
229 // for it's synthetic WheelEvent to be handled.
230 bool pending_touchpad_pinch_;
231 // When |mouse_wheel_pending_| is true, indicates whether the current wheel
232 // event is in fact a synthetic event for touchpad pinch.
233 bool current_wheel_event_is_for_pinch_;
234 // When |pending_touchpad_pinch_| is true, this is the synthetic wheel event
235 // that will be or (if |current_wheel_event_is_for_pinch_ is true) has
236 // already been sent representing the pinch.
237 MouseWheelEventWithLatencyInfo wheel_event_for_pending_pinch_;
238
224 // (Similar to |next_mouse_move_|.) The next mouse wheel events to send. 239 // (Similar to |next_mouse_move_|.) The next mouse wheel events to send.
225 // Unlike mouse moves, mouse wheel events received while one is pending are 240 // Unlike mouse moves, mouse wheel events received while one is pending are
226 // coalesced (by accumulating deltas) if they match the previous event in 241 // coalesced (by accumulating deltas) if they match the previous event in
227 // modifiers. On the Mac, in particular, mouse wheel events are received at a 242 // modifiers. On the Mac, in particular, mouse wheel events are received at a
228 // high rate; not waiting for the ack results in jankiness, and using the same 243 // high rate; not waiting for the ack results in jankiness, and using the same
229 // mechanism as for mouse moves (just dropping old events when multiple ones 244 // mechanism as for mouse moves (just dropping old events when multiple ones
230 // would be queued) results in very slow scrolling. 245 // would be queued) results in very slow scrolling.
231 typedef std::deque<MouseWheelEventWithLatencyInfo> WheelEventQueue; 246 typedef std::deque<MouseWheelEventWithLatencyInfo> WheelEventQueue;
232 WheelEventQueue coalesced_mouse_wheel_events_; 247 WheelEventQueue coalesced_mouse_wheel_events_;
233 248
(...skipping 25 matching lines...) Expand all
259 GestureEventQueue gesture_event_queue_; 274 GestureEventQueue gesture_event_queue_;
260 TouchActionFilter touch_action_filter_; 275 TouchActionFilter touch_action_filter_;
261 InputEventStreamValidator event_stream_validator_; 276 InputEventStreamValidator event_stream_validator_;
262 277
263 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); 278 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl);
264 }; 279 };
265 280
266 } // namespace content 281 } // namespace content
267 282
268 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ 283 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698