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

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

Issue 12262016: Adding IME test changes to make it easier to test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Ted's nits Created 7 years, 10 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/ImeAdapter.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
index e5ddc2987ac770e604509d1ebe563f20667b9fd5..aa2a2184f09912fb4d9ad5135d123d0242bad5f8 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java
@@ -280,7 +280,8 @@ class ImeAdapter {
}
}
- private boolean checkCompositionQueueAndCallNative(String text, int newCursorPosition,
+ @VisibleForTesting
+ boolean checkCompositionQueueAndCallNative(String text, int newCursorPosition,
boolean isCommit) {
if (mNativeImeAdapterAndroid == 0) {
return false;
@@ -461,20 +462,21 @@ class ImeAdapter {
return true;
}
+ public static class AdapterInputConnectionFactory {
+ public AdapterInputConnection get(View view, ImeAdapter imeAdapter,
+ EditorInfo outAttrs) {
+ return new AdapterInputConnection(view, imeAdapter, outAttrs);
+ }
+ }
+
// This InputConnection is created by ContentView.onCreateInputConnection.
// It then adapts android's IME to chrome's RenderWidgetHostView using the
// native ImeAdapterAndroid via the outer class ImeAdapter.
- static public class AdapterInputConnection extends BaseInputConnection {
+ public static class AdapterInputConnection extends BaseInputConnection {
private View mInternalView;
private ImeAdapter mImeAdapter;
private boolean mSingleLine;
- // Factory function.
- static public AdapterInputConnection getInstance(View view, ImeAdapter imeAdapter,
- EditorInfo outAttrs) {
- return new AdapterInputConnection(view, imeAdapter, outAttrs);
- }
-
/**
* Updates the AdapterInputConnection's internal representation of the text
* being edited and its selection and composition properties. The resulting
@@ -522,7 +524,6 @@ class ImeAdapter {
}
Selection.setSelection(editable, selectionStart, selectionEnd);
super.setComposingRegion(compositionStart, compositionEnd);
-
if (textUnchanged || prevText.equals("")) {
// updateSelection should be called when a manual selection change occurs.
// Should not be called if text is being entered else issues can occur
@@ -685,7 +686,8 @@ class ImeAdapter {
.getSystemService(Context.INPUT_METHOD_SERVICE);
}
- private AdapterInputConnection(View view, ImeAdapter imeAdapter, EditorInfo outAttrs) {
+ @VisibleForTesting
+ protected AdapterInputConnection(View view, ImeAdapter imeAdapter, EditorInfo outAttrs) {
super(view, true);
mInternalView = view;
mImeAdapter = imeAdapter;

Powered by Google App Engine
This is Rietveld 408576698