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

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

Issue 443193006: Show icons in Android web autofill dropdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix up build files Created 6 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
Index: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java
index 7c2f4271ac9e5976da9c85468b298f3a01f69a4d..1f4407c36857b9cf2f2b65ca645513c0c50aac3b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java
@@ -9,6 +9,8 @@ import android.os.Handler;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
+import org.chromium.chrome.browser.ResourceId;
+import org.chromium.ui.DropdownItem;
import org.chromium.ui.autofill.AutofillPopup;
import org.chromium.ui.autofill.AutofillPopup.AutofillPopupDelegate;
import org.chromium.ui.autofill.AutofillSuggestion;
@@ -101,12 +103,14 @@ public class AutofillPopupBridge implements AutofillPopupDelegate{
* @param index Index in the array where to place a new suggestion.
* @param label First line of the suggestion.
* @param sublabel Second line of the suggestion.
- * @param uniqueId Unique suggestion id.
+ * @param iconId The resource ID for the icon associated with the suggestion, or 0 for no icon.
+ * @param suggestionId Identifier for the suggestion type.
*/
@CalledByNative
private static void addToAutofillSuggestionArray(AutofillSuggestion[] array, int index,
- String label, String sublabel, int uniqueId) {
- array[index] = new AutofillSuggestion(label, sublabel, uniqueId);
+ String label, String sublabel, int iconId, int suggestionId) {
+ int drawableId = iconId == 0 ? DropdownItem.NO_ICON : ResourceId.mapToDrawableId(iconId);
+ array[index] = new AutofillSuggestion(label, sublabel, drawableId, suggestionId);
}
private native void nativePopupDismissed(long nativeAutofillPopupViewAndroid);

Powered by Google App Engine
This is Rietveld 408576698