Commit 1f434d17 authored by estade's avatar estade Committed by Commit bot

Autofill dropdown icons:

1. Use camera icon for "Scan new card".
2. Fix regression where icon wasn't showing

BUG=441534,441533
TBR=jochen@chromium.org

Review URL: https://codereview.chromium.org/802553003

Cr-Commit-Position: refs/heads/master@{#308425}
parent 75355849
......@@ -52,5 +52,6 @@ DEFINE_RESOURCE_ID(IDR_AUTOFILL_CC_GENERIC, R.drawable.generic_card)
DEFINE_RESOURCE_ID(IDR_AUTOFILL_CC_JCB, R.drawable.generic_card)
DEFINE_RESOURCE_ID(IDR_AUTOFILL_CC_MASTERCARD, R.drawable.mc_card)
DEFINE_RESOURCE_ID(IDR_AUTOFILL_CC_VISA, R.drawable.visa_card)
DEFINE_RESOURCE_ID(IDR_AUTOFILL_CC_SCAN_NEW, android.R.drawable.ic_menu_camera)
#endif // CHROME_BROWSER_ANDROID_RESOURCE_ID_H_
......@@ -59,6 +59,7 @@ const DataResource kDataResources[] = {
{ "jcbCC", IDR_AUTOFILL_CC_JCB },
{ "masterCardCC", IDR_AUTOFILL_CC_MASTERCARD },
{ "visaCC", IDR_AUTOFILL_CC_VISA },
{ "scanCreditCardIcon", IDR_AUTOFILL_CC_SCAN_NEW },
#if defined(OS_MACOSX) && !defined(OS_IOS)
{ "macContactsIcon", IDR_AUTOFILL_MAC_CONTACTS_ICON },
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
......
......@@ -8,6 +8,7 @@ per-file app_modal*=avi@chromium.org
# Can not match autofill* due to crbug.com/397984
per-file autofill.gypi=estade@chromium.org
per-file autofill.gypi=isherman@chromium.org
per-file autofill_scaled_resources.grdp=estade@chromium.org
per-file autofill_strings.grdp=estade@chromium.org
per-file autofill_strings.grdp=isherman@chromium.org
......
......@@ -123,7 +123,7 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
if (should_show_scan_credit_card_) {
values.push_back(l10n_util::GetStringUTF16(IDS_AUTOFILL_SCAN_CREDIT_CARD));
labels.push_back(base::string16());
icons.push_back(base::string16());
icons.push_back(base::ASCIIToUTF16("scanCreditCardIcon"));
ids.push_back(POPUP_ITEM_ID_SCAN_CREDIT_CARD);
if (!has_shown_popup_for_current_edit_) {
......
......@@ -7,5 +7,7 @@
<structure type="chrome_scaled_image" name="IDR_AUTOFILL_CC_JCB" file="common/autofill/jcb.png" />
<structure type="chrome_scaled_image" name="IDR_AUTOFILL_CC_MASTERCARD" file="common/autofill/mastercard.png" />
<structure type="chrome_scaled_image" name="IDR_AUTOFILL_CC_VISA" file="common/autofill/visa.png" />
<!-- This is not used on desktop, only Android, so use a placeholder file. -->
<structure type="chrome_scaled_image" name="IDR_AUTOFILL_CC_SCAN_NEW" file="common/autofill/cc-generic.png" />
<structure type="chrome_scaled_image" name="IDR_AUTOFILL_MAC_CONTACTS_ICON" file="common/autofill/mac_contacts_icon.png" />
</grit-part>
......@@ -11,10 +11,11 @@
android:layout_height="wrap_content"
android:gravity="center_vertical">
<!-- These layout params are overwritten in DropdownAdapter.java -->
<LinearLayout android:id="@+id/dropdown_label_wrapper"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:orientation="vertical"
android:gravity="center_vertical">
......
......@@ -88,7 +88,8 @@ public class DropdownAdapter extends ArrayAdapter<DropdownItem> {
// it doesn't regress.
// http://crbug.com/429364
View wrapper = layout.findViewById(R.id.dropdown_label_wrapper);
wrapper.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, height));
wrapper.setLayoutParams(
new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, height, 1));
DropdownItem item = getItem(position);
TextView labelView = (TextView) layout.findViewById(R.id.dropdown_label);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment