Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java

Issue 2392463002: DO NOT SUBMIT: Fix input action type for Android
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/FocusController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
index b62b29399748ca059158201165b3101af878a41c..5bc63b842b613fc211907efbd5a495c46d71bc4e 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
@@ -45,7 +45,6 @@ public class ImeUtils {
if (inputType == TextInputType.TEXT) {
// Normal text field
- outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
if ((inputFlags & WebTextInputFlags.AutocorrectOff) == 0) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
}
@@ -55,32 +54,25 @@ public class ImeUtils {
if ((inputFlags & WebTextInputFlags.AutocorrectOff) == 0) {
outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
}
- outAttrs.imeOptions |= EditorInfo.IME_ACTION_NONE;
} else if (inputType == TextInputType.PASSWORD) {
outAttrs.inputType =
InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD;
- outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
} else if (inputType == TextInputType.SEARCH) {
- outAttrs.imeOptions |= EditorInfo.IME_ACTION_SEARCH;
} else if (inputType == TextInputType.URL) {
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
- outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
} else if (inputType == TextInputType.EMAIL) {
// Email
outAttrs.inputType =
InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
- outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
} else if (inputType == TextInputType.TELEPHONE) {
// Telephone
// Number and telephone do not have both a Tab key and an
// action in default OSK, so set the action to NEXT
outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
- outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
} else if (inputType == TextInputType.NUMBER) {
// Number
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER
| InputType.TYPE_NUMBER_VARIATION_NORMAL | InputType.TYPE_NUMBER_FLAG_DECIMAL;
- outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
}
// Handling of autocapitalize. Blink will send the flag taking into account the element's
@@ -99,6 +91,16 @@ public class ImeUtils {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
}
+ if (inputType == TextInputType.SEARCH) {
+ outAttrs.imeOptions |= EditorInfo.IME_ACTION_SEARCH;
+ } else if ((inputFlags & WebTextInputFlags.ActionNone) != 0) {
+ outAttrs.imeOptions |= EditorInfo.IME_ACTION_NONE;
+ } else if ((inputFlags & WebTextInputFlags.ActionNext) != 0) {
+ outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
+ } else if ((inputFlags & WebTextInputFlags.ActionGo) != 0) {
+ outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
+ }
+
outAttrs.initialSelStart = initialSelStart;
outAttrs.initialSelEnd = initialSelEnd;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/FocusController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698