diff options
author | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-10 19:52:42 +0000 |
---|---|---|
committer | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-10 19:52:42 +0000 |
commit | 659b54de61e802560a32d43509023d576633fe66 (patch) | |
tree | fa1a963371b51df16b039d88e3c9414f09e60ef3 /ui/android | |
parent | c86f4decaba472222fc9f631189ed9243ee2ca08 (diff) | |
download | chromium_src-659b54de61e802560a32d43509023d576633fe66.zip chromium_src-659b54de61e802560a32d43509023d576633fe66.tar.gz chromium_src-659b54de61e802560a32d43509023d576633fe66.tar.bz2 |
Allows logging the field names used by autofill.
BUG=341493
Review URL: https://codereview.chromium.org/150503003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/android')
-rw-r--r-- | ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java b/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java index af6951c..06126a3d 100644 --- a/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java +++ b/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java @@ -56,6 +56,20 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem private List<AutofillSuggestion> mSuggestions; /** + * An interface that can be injected to log field names selected by + * the autofill. + */ + public interface AutofillLogger { + public void logSuggestionSelected(String fieldName); + } + + private static AutofillLogger sAutofillLogger = null; + + public static void setAutofillLogger(AutofillLogger autofillLogger) { + sAutofillLogger = autofillLogger; + } + + /** * An interface to handle the touch interaction with an AutofillPopup object. */ public interface AutofillPopupDelegate { @@ -219,8 +233,12 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { AutofillListAdapter adapter = (AutofillListAdapter) parent.getAdapter(); - int listIndex = mSuggestions.indexOf(adapter.getItem(position)); + AutofillSuggestion selectedSuggestion = adapter.getItem(position); + int listIndex = mSuggestions.indexOf(selectedSuggestion); assert listIndex > -1; + if (sAutofillLogger != null) { + sAutofillLogger.logSuggestionSelected(selectedSuggestion.mLabel); + } mAutofillCallback.suggestionSelected(listIndex); } |