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

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

Issue 1278593004: Introduce ThreadedInputConnection behind a switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/AdapterInputConnection.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
index f6ab5b0c31bd5cd9a3312fbe540f979dff6b3eb6..468c14c12aa26e5907c3d467f97b4bf1b9a84017 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
@@ -29,7 +29,8 @@ import org.chromium.ui.base.ime.TextInputType;
* It then adapts android's IME to chrome's RenderWidgetHostView using the
* native ImeAdapterAndroid via the class ImeAdapter.
*/
-public class AdapterInputConnection extends BaseInputConnection {
+public class AdapterInputConnection
+ extends BaseInputConnection implements ChromiumBaseInputConnection {
private static final String TAG = "cr.Ime";
/**
* Selection value should be -1 if not known. See EditorInfo.java for details.
@@ -155,24 +156,7 @@ public class AdapterInputConnection extends BaseInputConnection {
return builder.toString();
}
- /**
- * Updates the AdapterInputConnection's internal representation of the text being edited and
- * its selection and composition properties. The resulting Editable is accessible through the
- * getEditable() method. If the text has not changed, this also calls updateSelection on the
- * InputMethodManager.
- *
- * @param text The String contents of the field being edited.
- * @param selectionStart The character offset of the selection start, or the caret position if
- * there is no selection.
- * @param selectionEnd The character offset of the selection end, or the caret position if there
- * is no selection.
- * @param compositionStart The character offset of the composition start, or -1 if there is no
- * composition.
- * @param compositionEnd The character offset of the composition end, or -1 if there is no
- * selection.
- * @param isNonImeChange True when the update was caused by non-IME (e.g. Javascript).
- */
- @VisibleForTesting
+ @Override
public void updateState(String text, int selectionStart, int selectionEnd, int compositionStart,
int compositionEnd, boolean isNonImeChange) {
Log.d(TAG, "updateState [%s] [%s %s] [%s %s] [%b]", text, selectionStart,
@@ -277,7 +261,7 @@ public class AdapterInputConnection extends BaseInputConnection {
public boolean performEditorAction(int actionCode) {
Log.d(TAG, "performEditorAction [%d]", actionCode);
if (actionCode == EditorInfo.IME_ACTION_NEXT) {
- restartInput();
+ getInputMethodManagerWrapper().restartInput(mInternalView);
// Send TAB key event
long timeStampMs = SystemClock.uptimeMillis();
mImeAdapter.sendSyntheticKeyEvent(
@@ -417,6 +401,14 @@ public class AdapterInputConnection extends BaseInputConnection {
}
/**
+ * @see ChromiumBaseInputConnection#dispatchKeyEvent(KeyEvent)
+ */
+ @Override
+ public boolean dispatchKeyEvent(KeyEvent event) {
+ return sendKeyEvent(event);
+ }
+
+ /**
* @see BaseInputConnection#sendKeyEvent(android.view.KeyEvent)
*/
@Override
@@ -527,7 +519,8 @@ public class AdapterInputConnection extends BaseInputConnection {
* Informs the InputMethodManager and InputMethodSession (i.e. the IME) that the text
* state is no longer what the IME has and that it needs to be updated.
*/
- void restartInput() {
+ @Override
+ public void restartInput() {
Log.d(TAG, "restartInput");
getInputMethodManagerWrapper().restartInput(mInternalView);
mNumNestedBatchEdits = 0;

Powered by Google App Engine
This is Rietveld 408576698