Commit 764ceed3 authored by lazyboy's avatar lazyboy Committed by Commit bot

Use guest's existing GestureRecognizer instead of global one.

This makes touch events work in <webview>.
Otherwise GestureRecognizer starts sending event to bogus Window*, which
crashes the browser.

BUG=413017
Test=
In a touch enabled device, open a chrome app that has a <webview>.
e.g. https://chrome.google.com/webstore/detail/edggnmnajhcbhlnpjnogkjpghaikidaa
Try doing the following actions, none of them should crash the browser.
1. Tap on an input box, e.g. by going to http://www.google.com.
2. Scrolling a page should work.
3. Go to a page that has no touch handlers, you should be able to scroll the
page w/o problem.
3. Go to a page that has touch handlers (e.g. touchstart), you should be able
to scroll the page w/o problem.
4. Go to a page that has preventDefault() on touchstart event, you shouldn't
be able to scroll the page.

Review URL: https://codereview.chromium.org/572763002

Cr-Commit-Position: refs/heads/master@{#294971}
parent fee2c497
......@@ -141,12 +141,11 @@ void RenderWidgetHostViewGuest::ProcessAckedTouchEvent(
INPUT_EVENT_ACK_STATE_CONSUMED) ? ui::ER_HANDLED : ui::ER_UNHANDLED;
for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(),
end = events.end(); iter != end; ++iter) {
if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(*(*iter),
this)) {
if (!gesture_recognizer_->ProcessTouchEventPreDispatch(*(*iter), this))
continue;
}
scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
gestures.reset(ui::GestureRecognizer::Get()->ProcessTouchEventPostDispatch(
gestures.reset(gesture_recognizer_->ProcessTouchEventPostDispatch(
*(*iter), result, this));
ProcessGestures(gestures.get());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment