PinchGesture routing in Blink

閲覧: 6 回
最初の未読メッセージにスキップ

Sean O'Brien

未読、
2017/09/21 16:40:572017/09/21
To: inpu...@chromium.org
Hello,

I'm working on adding some functionality for touchpad pinches to Chrome, and I'm having a little difficulty understanding the routing.

Namely, in input_handler_proxy, there is a check for a MouseWheel listener, and if one exists then pinch events are not handled.

I haven't been able to find where these events are sent, but they are getting through somehow (page is scaling).

Can you help me understand the routing?

-Sean

Majid Valipour

未読、
2017/09/21 17:41:362017/09/21
To: Sean O'Brien、inpu...@chromium.org
input_handler_proxy is responsible for handling events on impl thread.  Events that are not handled by are forwarded to main thread and eventually find their way to WebViewImpl::handleInputEvent. [1]

In this case, as you pointed out since there is a registered mouse wheel, the event has to be sent to main thread so that the event listener is called before the browser can perform its default action (i.e., pinch zoom). This is the relevant code in WebViewImpl that is responsible for synthesizing the wheel event and then doing a pinch zoom as a default action on main thread.

[1] The actual machinery that first passes event to impl thread and then if not consumed then dispatches to main thread is mainly in InputEventFilter (see ForwardToHandler and DidForwardToHandlerAndOverscroll). FYI that machinery is actually being overhauled as input event IPC is moving to mojo. 

Majid

Sean O'Brien

未読、
2017/09/21 19:34:272017/09/21
To: Majid Valipour、inpu...@chromium.org
Thanks Majid, this was very helpful.
全員に返信
投稿者に返信
転送
新着メール 0 件