Commit 44a3d7db authored by Aldo Culquicondor's avatar Aldo Culquicondor Committed by Commit Bot

VR: Fix autofill when clicking backspace

This CL ensures that a backspace is threated as a user gesture, so that
it causes the autofill popups to refresh.

Bug: 839518
Change-Id: Iaca3206c5da2b7ab35271bbeeb85b77c6d27bc09
Reviewed-on: https://chromium-review.googlesource.com/1130104Reviewed-by: default avatarAmirhossein Simjour <asimjour@chromium.org>
Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574172}
parent f83eec06
......@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.vr_shell;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
......@@ -89,7 +90,13 @@ public class VrInputConnection {
ic.commitText(edit.mText, edit.mNewCursorPosition);
break;
case TextEditActionType.DELETE_TEXT:
ic.deleteSurroundingText(-edit.mNewCursorPosition, 0);
// We only have delete actions for backspace. We cannot use
// deleteSurroundingText, because it is not treated as a user action.
// Instead, we submit the raw key event.
assert edit.mNewCursorPosition == -1;
ic.sendKeyEvent(
new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL));
ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
break;
case TextEditActionType.SET_COMPOSING_TEXT:
ic.setComposingText(edit.mText, edit.mNewCursorPosition);
......
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