Commit 26a4df44 authored by Aldo Culquicondor's avatar Aldo Culquicondor Committed by Commit Bot

VR: Show autofill popup on first touch

The VR keyboard doesn't take content space, so we don't need to wait
for a window resize to do the auto-scroll to the focused view. We
add a new parameter to the result receiver to indicate this.

Bug: 831368
Change-Id: I3d965ef9ffec8288ca2f6acc91c5f4fda8fc23f6
Reviewed-on: https://chromium-review.googlesource.com/1127928Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarAmirhossein Simjour <asimjour@chromium.org>
Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575009}
parent b14cbef8
......@@ -10,6 +10,7 @@ import android.os.ResultReceiver;
import android.view.View;
import android.view.inputmethod.CursorAnchorInfo;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
......@@ -67,6 +68,10 @@ public class VrInputMethodManagerWrapper implements InputMethodManagerWrapper {
EditorInfo outAttrs = new EditorInfo();
view.onCreateInputConnection(outAttrs);
mKeyboard.showSoftInput(true);
// Since the VR keyboard doesn't take content space, we report back to the ImeAdapter that
// the keyboard was always showing.
resultReceiver.send(InputMethodManager.RESULT_UNCHANGED_SHOWN, null);
}
@Override
......
......@@ -542,6 +542,8 @@ public class ImeAdapterImpl implements ImeAdapter, WindowEventObserver {
} else if (ViewUtils.hasFocus(containerView)
&& resultCode == InputMethodManager.RESULT_UNCHANGED_SHOWN) {
// If the OSK was already there, focus the form immediately.
// Also, the VR soft keyboard always reports RESULT_UNCHANGED_SHOWN as it
// doesn't affect the size of the web contents.
mWebContents.scrollFocusedEditableNodeIntoView();
}
}
......
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