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

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

Issue 2938123002: Revert of [Android] Adding Smart GO/NEXT feature in Chrome (Closed)
Patch Set: Created 3 years, 6 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
Index: content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
index de5b64a0ab2681a7dfa7b48d56f22b46057a5abe..0dc13ed95d8e0d83b6b02969c7c76234bcb62276 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
@@ -31,7 +31,6 @@
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
-import org.chromium.blink_public.web.WebFocusType;
import org.chromium.blink_public.web.WebInputEventModifier;
import org.chromium.blink_public.web.WebInputEventType;
import org.chromium.blink_public.web.WebTextInputMode;
@@ -634,30 +633,16 @@
boolean performEditorAction(int actionCode) {
if (!isValid()) return false;
- switch (actionCode) {
- case EditorInfo.IME_ACTION_NEXT:
- advanceFocusInForm(WebFocusType.FORWARD);
- break;
- case EditorInfo.IME_ACTION_PREVIOUS:
- advanceFocusInForm(WebFocusType.BACKWARD);
- break;
- default:
- sendSyntheticKeyPress(KeyEvent.KEYCODE_ENTER,
- KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE
- | KeyEvent.FLAG_EDITOR_ACTION);
- break;
+ if (actionCode == EditorInfo.IME_ACTION_NEXT) {
+ sendSyntheticKeyPress(KeyEvent.KEYCODE_TAB,
+ KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE
+ | KeyEvent.FLAG_EDITOR_ACTION);
+ } else {
+ sendSyntheticKeyPress(KeyEvent.KEYCODE_ENTER,
+ KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE
+ | KeyEvent.FLAG_EDITOR_ACTION);
}
return true;
- }
-
- /**
- * Advances the focus to next input field in the current form.
- *
- * @param focusType indicates whether to advance forward or backward direction.
- */
- private void advanceFocusInForm(int focusType) {
- if (mNativeImeAdapterAndroid == 0) return;
- nativeAdvanceFocusInForm(mNativeImeAdapterAndroid, focusType);
}
void notifyUserAction() {
@@ -935,5 +920,4 @@
private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapterAndroid);
private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid,
boolean immediateRequest, boolean monitorRequest);
- private native void nativeAdvanceFocusInForm(long nativeImeAdapterAndroid, int focusType);
}
« no previous file with comments | « content/common/frame_messages.h ('k') | content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698