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

Unified 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: Fix windows build and tweaks 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/input_router_impl.h
diff --git a/content/browser/renderer_host/input/input_router_impl.h b/content/browser/renderer_host/input/input_router_impl.h
index 8c512348a6bcf93988e02c4bf627d8055f9ce7fe..fb76a018f0cb1c97fb7ef495c72a1b6e5e25d78a 100644
--- a/content/browser/renderer_host/input/input_router_impl.h
+++ b/content/browser/renderer_host/input/input_router_impl.h
@@ -118,6 +118,27 @@ private:
const ui::LatencyInfo& latency_info,
bool is_keyboard_shortcut);
+ // A data structure that attaches some metadata to a WebMouseWheelEvent
+ // and it's latency info.
jdduke (slow) 2014/05/01 15:44:47 its
Rick Byers 2014/05/01 17:34:57 Done.
+ struct QueuedWheelEvent {
+ QueuedWheelEvent();
+ QueuedWheelEvent(const MouseWheelEventWithLatencyInfo& event,
+ bool synthesized_from_pinch);
+ ~QueuedWheelEvent();
+
+ MouseWheelEventWithLatencyInfo event;
+ bool synthesized_from_pinch;
+ };
+
+ // Enqueue or send a mouse wheel event.
+ void SendWheelEvent(const QueuedWheelEvent& wheel_event);
+
+ // Given a Touchpad GesturePinchUpdate event, create and send a synthetic
+ // wheel event for it.
+ void SendSyntheticWheelEventForPinch(
+ const blink::WebGestureEvent& pinch_event,
+ const ui::LatencyInfo& latency_info);
+
// IPC message handlers
void OnInputEventAck(blink::WebInputEvent::Type event_type,
InputEventAckState ack_result,
@@ -216,7 +237,7 @@ private:
// (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent
// and we are waiting for a corresponding ack.
bool mouse_wheel_pending_;
- MouseWheelEventWithLatencyInfo current_wheel_event_;
+ QueuedWheelEvent current_wheel_event_;
// (Similar to |next_mouse_move_|.) The next mouse wheel events to send.
// Unlike mouse moves, mouse wheel events received while one is pending are
@@ -225,7 +246,7 @@ private:
// high rate; not waiting for the ack results in jankiness, and using the same
// mechanism as for mouse moves (just dropping old events when multiple ones
// would be queued) results in very slow scrolling.
- typedef std::deque<MouseWheelEventWithLatencyInfo> WheelEventQueue;
+ typedef std::deque<QueuedWheelEvent> WheelEventQueue;
WheelEventQueue coalesced_mouse_wheel_events_;
// A queue of keyboard events. We can't trust data from the renderer so we

Powered by Google App Engine
This is Rietveld 408576698