Commit 8973380a authored by lazyboy@chromium.org's avatar lazyboy@chromium.org

Focus plugin on gesturetapdown.

We focus the plugin on mousedown/touchstart, so similarly we should
focus it on gesturetapdown.

This fixes IME input on plugins, if a plugin gets gesturetapdown
without any mousedown/touchstart, the plugin will be focused correctly
and input fed to the plugin would work properly.
This could happen if the plugin doesn't have any touch handlers, then
tapping sends gesture event(s) to plugin, without any touchstart.

BUG=383484
Test=Using chrome app webview, which is a plugin.
Enable virutal keyboard in chrome://flags if it's not enabled.
In chromebook pixel: load the sample
browser app
https://github.com/GoogleChrome/chrome-app-samples/tree/master/webview-samples/browser
Navigate to a simple page that has <input> element, e.g.
http://jsbin.com/togif/1/
Now without generating any mouse/touchpad inside the content area, tap on the screen on the input box in the jsbin page.
Notice virtual keyboard opening and it is possible to type stuffs into the input box.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176152 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5ad4b62b
...@@ -837,6 +837,8 @@ void WebPluginContainerImpl::handleGestureEvent(GestureEvent* event) ...@@ -837,6 +837,8 @@ void WebPluginContainerImpl::handleGestureEvent(GestureEvent* event)
WebGestureEventBuilder webEvent(this, m_element->renderer(), *event); WebGestureEventBuilder webEvent(this, m_element->renderer(), *event);
if (webEvent.type == WebInputEvent::Undefined) if (webEvent.type == WebInputEvent::Undefined)
return; return;
if (event->type() == EventTypeNames::gesturetapdown)
focusPlugin();
WebCursorInfo cursorInfo; WebCursorInfo cursorInfo;
if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) { if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) {
event->setDefaultHandled(); event->setDefaultHandled();
......
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