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

Unified Diff: trunk/src/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java

Issue 68243003: Revert 234194 "Add support for datalist to text input element on..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « trunk/src/ui/android/java/src/org/chromium/ui/autofill/AutofillListAdapter.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java
===================================================================
--- trunk/src/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java (revision 234202)
+++ trunk/src/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java (working copy)
@@ -16,9 +16,6 @@
import android.widget.TextView;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
import org.chromium.ui.R;
import org.chromium.ui.ViewAndroidDelegate;
@@ -32,12 +29,11 @@
* Constants defining types of Autofill suggestion entries.
* Has to be kept in sync with enum in WebAutofillClient.h
*
- * Not supported: MenuItemIDWarningMessage, MenuItemIDClearForm, and
+ * Not supported: MenuItemIDWarningMessage, MenuItemIDSeparator, MenuItemIDClearForm, and
* MenuItemIDAutofillOptions.
*/
private static final int ITEM_ID_AUTOCOMPLETE_ENTRY = 0;
private static final int ITEM_ID_PASSWORD_ENTRY = -2;
- private static final int ITEM_ID_SEPARATOR_ENTRY = -3;
private static final int ITEM_ID_DATA_LIST_ENTRY = -6;
private static final int TEXT_PADDING_DP = 30;
@@ -53,7 +49,6 @@
private Paint mLabelViewPaint;
private Paint mSublabelViewPaint;
private OnLayoutChangeListener mLayoutChangeListener;
- private List<AutofillSuggestion> mSuggestions;
/**
* An interface to handle the touch interaction with an AutofillPopup object.
@@ -110,7 +105,6 @@
// An ugly hack to keep the popup from expanding on top of the keyboard.
setInputMethodMode(INPUT_METHOD_NEEDED);
super.show();
- getListView().setDividerHeight(0);
}
/**
@@ -137,20 +131,16 @@
* @param suggestions Autofill suggestion data.
*/
public void show(AutofillSuggestion[] suggestions) {
- mSuggestions = new ArrayList<AutofillSuggestion>(Arrays.asList(suggestions));
// Remove the AutofillSuggestions with IDs that are not supported by Android
ArrayList<AutofillSuggestion> cleanedData = new ArrayList<AutofillSuggestion>();
- HashSet<Integer> separators = new HashSet<Integer>();
for (int i = 0; i < suggestions.length; i++) {
int itemId = suggestions[i].mUniqueId;
if (itemId > 0 || itemId == ITEM_ID_AUTOCOMPLETE_ENTRY ||
itemId == ITEM_ID_PASSWORD_ENTRY || itemId == ITEM_ID_DATA_LIST_ENTRY) {
cleanedData.add(suggestions[i]);
- } else if (itemId == ITEM_ID_SEPARATOR_ENTRY) {
- separators.add(cleanedData.size());
}
}
- setAdapter(new AutofillListAdapter(mContext, cleanedData, separators));
+ setAdapter(new AutofillListAdapter(mContext, cleanedData));
// Once the mAnchorRect is resized and placed correctly, it will show the Autofill popup.
mAnchorWidth = Math.max(getDesiredWidth(cleanedData), mAnchorWidth);
mViewAndroidDelegate.setAnchorViewPosition(mAnchorView, mAnchorX, mAnchorY, mAnchorWidth,
@@ -218,10 +208,7 @@
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- AutofillListAdapter adapter = (AutofillListAdapter) parent.getAdapter();
- int listIndex = mSuggestions.indexOf(adapter.getItem(position));
- assert listIndex > -1;
- mAutofillCallback.suggestionSelected(listIndex);
+ mAutofillCallback.suggestionSelected(position);
}
}
« no previous file with comments | « trunk/src/ui/android/java/src/org/chromium/ui/autofill/AutofillListAdapter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698