Index: chrome/browser/ui/android/autofill/autofill_popup_view_android.cc |
diff --git a/chrome/browser/ui/android/autofill/autofill_popup_view_android.cc b/chrome/browser/ui/android/autofill/autofill_popup_view_android.cc |
index baf38d92a731cce6b0e343199bcd907381e4243e..5e4acdcec3b56b95b9aab2bd6c0affd5a2a91675 100644 |
--- a/chrome/browser/ui/android/autofill/autofill_popup_view_android.cc |
+++ b/chrome/browser/ui/android/autofill/autofill_popup_view_android.cc |
@@ -9,6 +9,7 @@ |
#include "chrome/browser/android/resource_mapper.h" |
#include "chrome/browser/ui/android/window_android_helper.h" |
#include "chrome/browser/ui/autofill/autofill_popup_controller.h" |
+#include "components/autofill/core/browser/suggestion.h" |
#include "content/public/browser/android/content_view_core.h" |
#include "jni/AutofillPopupBridge_jni.h" |
#include "ui/base/android/view_android.h" |
@@ -56,32 +57,32 @@ void AutofillPopupViewAndroid::UpdateBoundsAndRedrawPopup() { |
controller_->element_bounds().width(), |
controller_->element_bounds().height()); |
- // We need an array of AutofillSuggestion. |
- size_t count = controller_->names().size(); |
- |
+ size_t count = controller_->GetLineCount(); |
ScopedJavaLocalRef<jobjectArray> data_array = |
Java_AutofillPopupBridge_createAutofillSuggestionArray(env, count); |
for (size_t i = 0; i < count; ++i) { |
- ScopedJavaLocalRef<jstring> name = |
- base::android::ConvertUTF16ToJavaString(env, controller_->names()[i]); |
- ScopedJavaLocalRef<jstring> subtext = |
- base::android::ConvertUTF16ToJavaString(env, |
- controller_->subtexts()[i]); |
+ ScopedJavaLocalRef<jstring> value = base::android::ConvertUTF16ToJavaString( |
+ env, controller_->GetElidedValueAt(i)); |
+ ScopedJavaLocalRef<jstring> label = |
+ base::android::ConvertUTF16ToJavaString( |
+ env, controller_->GetElidedLabelAt(i)); |
int android_icon_id = 0; |
- if (!controller_->icons()[i].empty()) { |
+ |
+ const autofill::Suggestion& suggestion = controller_->GetSuggestionAt(i); |
+ if (!suggestion.icon.empty()) { |
android_icon_id = ResourceMapper::MapFromChromiumId( |
- controller_->GetIconResourceID(controller_->icons()[i])); |
+ controller_->GetIconResourceID(suggestion.icon)); |
} |
Java_AutofillPopupBridge_addToAutofillSuggestionArray( |
env, |
data_array.obj(), |
i, |
- name.obj(), |
- subtext.obj(), |
+ value.obj(), |
+ label.obj(), |
android_icon_id, |
- controller_->identifiers()[i]); |
+ suggestion.frontend_id); |
} |
Java_AutofillPopupBridge_show( |