diff options
| author | Leon Scroggins <scroggo@google.com> | 2009-06-26 17:45:29 -0400 |
|---|---|---|
| committer | Leon Scroggins <scroggo@google.com> | 2009-06-29 10:50:17 -0400 |
| commit | 0ca70883d752cce77b918421ef81f3134f6ccd1e (patch) | |
| tree | df39917515466eda0ea88d60bf3155ed2894ff12 /core/java/android/webkit/WebTextView.java | |
| parent | 0658e8fe4592a26de34170b62a19463fd2add47b (diff) | |
Assign a field name for textfields in the browser.
Fix for http://b/issue?id=1605291. Store the url and name of the
textfield in EditorInfo.fieldName.
Diffstat (limited to 'core/java/android/webkit/WebTextView.java')
| -rw-r--r-- | core/java/android/webkit/WebTextView.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index 79896f26661a..d1904b7be1c8 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -25,13 +25,14 @@ import android.text.Spannable; import android.text.TextUtils; import android.text.method.MovementMethod; import android.util.Log; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputMethodManager; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethodManager; +import android.view.inputmethod.InputConnection; import android.widget.AbsoluteLayout.LayoutParams; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; @@ -269,6 +270,18 @@ import java.util.ArrayList; return ptr == mNodePointer; } + @Override public InputConnection onCreateInputConnection( + EditorInfo outAttrs) { + InputConnection connection = super.onCreateInputConnection(outAttrs); + if (mWebView != null) { + // Use the name of the textfield + the url. Use backslash as an + // arbitrary separator. + outAttrs.fieldName = mWebView.nativeFocusCandidateName() + "\\" + + mWebView.getUrl(); + } + return connection; + } + @Override protected void onSelectionChanged(int selStart, int selEnd) { if (mWebView != null) { |
