Commit 8477fbb1 authored by scheib's avatar scheib Committed by Commit bot

Revert of Send autocapitalize flags to the Android virtual keyboard based on...

Revert of Send autocapitalize flags to the Android virtual keyboard based on Blink hints. (patchset #6 id:100001 of https://codereview.chromium.org/1003143002/)

Reason for revert:
compile fail on
http://build.chromium.org/p/chromium.linux/builders/Android%20Arm64%20Builder%20%28dbg%29/builds/13039

../content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java:128:error: cannot find symbol
        if ((inputFlags & WebTextInputFlags.AutocapitalizeCharacters) != 0) {

Original issue's description:
> Send autocapitalize flags to the Android virtual keyboard based on Blink hints.
>
> This changes the behaviour of AdapterInputConnection to pass a
> InputType.TYPE_TEXT_FLAG_CAP_* based on the
> WebTextInputFlags.Autocapitalize* instead of doing it purely based on the
> element's type.
>
> This CL requires the following Blink CL:
> https://codereview.chromium.org/995363002
>
> BUG=466930
>
> Committed: https://crrev.com/d1421a5faf9dc2d3b3cad10640576b24a092d9ba
> Cr-Commit-Position: refs/heads/master@{#322414}

TBR=aurimas@chromium.org,shuchen@chromium.org,mlamouri@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=466930

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

Cr-Commit-Position: refs/heads/master@{#322419}
parent ecda8292
...@@ -83,7 +83,9 @@ public class AdapterInputConnection extends BaseInputConnection { ...@@ -83,7 +83,9 @@ public class AdapterInputConnection extends BaseInputConnection {
} }
} else if (inputType == TextInputType.TEXT_AREA } else if (inputType == TextInputType.TEXT_AREA
|| inputType == TextInputType.CONTENT_EDITABLE) { || inputType == TextInputType.CONTENT_EDITABLE) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE; // TextArea or contenteditable.
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE
| EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES;
if ((inputFlags & WebTextInputFlags.AutocorrectOff) == 0) { if ((inputFlags & WebTextInputFlags.AutocorrectOff) == 0) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
} }
...@@ -120,23 +122,6 @@ public class AdapterInputConnection extends BaseInputConnection { ...@@ -120,23 +122,6 @@ public class AdapterInputConnection extends BaseInputConnection {
| InputType.TYPE_NUMBER_FLAG_DECIMAL; | InputType.TYPE_NUMBER_FLAG_DECIMAL;
outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT; outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
} }
// Handling of autocapitalize. Blink will send the flag taking into account the element's
// type. This is not using AutocapitalizeNone because Android does not autocapitalize by
// default and there is no way to express no capitalization.
// Autocapitalize is meant as a hint to the virtual keyboard.
if ((inputFlags & WebTextInputFlags.AutocapitalizeCharacters) != 0) {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS;
} else if ((inputFlags & WebTextInputFlags.AutocapitalizeWords) != 0) {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_WORDS;
} else if ((inputFlags & WebTextInputFlags.AutocapitalizeSentences) != 0) {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
}
// Content editable doesn't use autocapitalize so we need to set it manually.
if (inputType == TextInputType.CONTENT_EDITABLE) {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
}
outAttrs.initialSelStart = Selection.getSelectionStart(mEditable); outAttrs.initialSelStart = Selection.getSelectionStart(mEditable);
outAttrs.initialSelEnd = Selection.getSelectionEnd(mEditable); outAttrs.initialSelEnd = Selection.getSelectionEnd(mEditable);
mLastUpdateSelectionStart = outAttrs.initialSelStart; mLastUpdateSelectionStart = outAttrs.initialSelStart;
......
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