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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java

Issue 11299287: Fixing missing password Autofill popup for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing nits Created 8 years 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 | « no previous file | chrome/renderer/autofill/password_autofill_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java
index 22e469fe4707021972fe65a4e6faf8f7b4f93e90..1d76041aa2aa9b75f8da4f249485706e1039655e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java
@@ -30,6 +30,17 @@ import org.chromium.ui.gfx.NativeWindow;
*/
public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItemClickListener {
+ /**
+ * Constants defining types of Autofill suggestion entries.
+ * Has to be kept in sync with enum in WebAutofillClient.h
+ *
+ * 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_DATA_LIST_ENTRY = -6;
+
private static final int TEXT_PADDING_DP = 30;
private final AutofillPopupDelegate mAutofillCallback;
@@ -126,10 +137,14 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem
* @param suggestions Autofill suggestion data.
*/
public void show(AutofillSuggestion[] suggestions) {
- // Remove the AutofillSuggestions with IDs that are unsupported by Android
+ // Remove the AutofillSuggestions with IDs that are not supported by Android
ArrayList<AutofillSuggestion> cleanedData = new ArrayList<AutofillSuggestion>();
for (int i = 0; i < suggestions.length; i++) {
- if (suggestions[i].mUniqueId >= 0) cleanedData.add(suggestions[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]);
+ }
}
mAnchorView.setSize(mAnchorRect, getDesiredWidth(suggestions));
setAnchorView(mAnchorView);
« no previous file with comments | « no previous file | chrome/renderer/autofill/password_autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698