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

Unified Diff: chrome/browser/ui/android/autofill/autofill_popup_view_android.cc

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
« no previous file with comments | « chrome/browser/android/resource_mapper.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6e95ff9b64cbe681f3c2ff5177806b778713c4af..858ae1932f9fe935424dc9a399eb7cf580ac6dff 100644
--- a/chrome/browser/ui/android/autofill/autofill_popup_view_android.cc
+++ b/chrome/browser/ui/android/autofill/autofill_popup_view_android.cc
@@ -6,12 +6,15 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
+#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 "content/public/browser/android/content_view_core.h"
#include "jni/AutofillPopupBridge_jni.h"
#include "ui/base/android/view_android.h"
#include "ui/base/android/window_android.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/rect.h"
namespace autofill {
@@ -65,12 +68,19 @@ void AutofillPopupViewAndroid::UpdateBoundsAndRedrawPopup() {
ScopedJavaLocalRef<jstring> subtext =
base::android::ConvertUTF16ToJavaString(env,
controller_->subtexts()[i]);
+ int android_icon_id = 0;
+ if (!controller_->icons()[i].empty()) {
+ android_icon_id = ResourceMapper::MapFromChromiumId(
+ controller_->GetIconResourceID(controller_->icons()[i]));
+ }
+
Java_AutofillPopupBridge_addToAutofillSuggestionArray(
env,
data_array.obj(),
i,
name.obj(),
subtext.obj(),
+ android_icon_id,
controller_->identifiers()[i]);
}
« no previous file with comments | « chrome/browser/android/resource_mapper.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698