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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java

Issue 2966103002: [Payments] Show admin area complete names on PR form. (Closed)
Patch Set: Unit-tests added. Created 3 years, 5 months 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/payments/AddressEditor.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
index 2e0681bb6126996e838ebde71204b1c43aabc3b3..f757369062c381bab71e2b8b1eb83d03b29de2b8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
@@ -312,12 +312,12 @@ public class AddressEditor
}
@Override
- public void onSubKeysReceived(String[] adminAreas) {
+ public void onSubKeysReceived(String[] adminAreaCodes, String[] adminAreaNames) {
if (mAdminAreasLoaded) return;
mAdminAreasLoaded = true;
mAddressFields.put(AddressField.ADMIN_AREA,
- contains(adminAreas, mProfile.getRegion())
+ contains(adminAreaCodes, mProfile.getRegion())
sebsg 2017/07/07 18:05:04 Since you now have the names too, could you check
Parastoo 2017/07/10 15:40:19 Done.
? EditorFieldModel.createDropdown()
: EditorFieldModel.createTextInput(
EditorFieldModel.INPUT_TYPE_HINT_REGION));
@@ -333,16 +333,16 @@ public class AddressEditor
// For example, "US" will not add dependent locality to the editor. A "JP" address will
// start with a person's full name or a with a prefecture name, depending on whether the
// language code is "ja-Latn" or "ja".
- addAddressFieldsToEditor(
- mRecentlySelectedCountry, Locale.getDefault().getLanguage(), adminAreas);
+ addAddressFieldsToEditor(mRecentlySelectedCountry, Locale.getDefault().getLanguage(),
+ adminAreaCodes, adminAreaNames);
// Notify EditorDialog that the fields in the model have changed. EditorDialog should
// re-read the model and update the UI accordingly.
mHandler.post(mCountryChangeCallback);
} else {
// This should be called when all required fields are put in mAddressField.
setAddressFieldValuesFromCache();
- addAddressFieldsToEditor(
- mProfile.getCountryCode(), mProfile.getLanguageCode(), adminAreas);
+ addAddressFieldsToEditor(mProfile.getCountryCode(), mProfile.getLanguageCode(),
+ adminAreaCodes, adminAreaNames);
mEditorDialog.show(mEditor);
}
}
@@ -365,7 +365,7 @@ public class AddressEditor
// fetch the admin-areas, and show a text-field instead.
// This is to have the tests independent of the network status.
if (PersonalDataManager.getInstance().getRequestTimeoutMS() == 0) {
- onSubKeysReceived(null);
+ onSubKeysReceived(null, null);
return;
}
@@ -378,8 +378,8 @@ public class AddressEditor
* Adds fields to the editor model based on the country and language code of
* the profile that's being edited.
*/
- private void addAddressFieldsToEditor(
- String countryCode, String languageCode, String[] adminAreas) {
+ private void addAddressFieldsToEditor(String countryCode, String languageCode,
+ String[] adminAreaCodes, String[] adminAreaNames) {
mAddressUiComponents =
mAutofillProfileBridge.getAddressUiComponents(countryCode, languageCode);
// In terms of order, country must be the first field.
@@ -395,8 +395,8 @@ public class AddressEditor
|| component.id == AddressField.DEPENDENT_LOCALITY);
if (component.id == AddressField.ADMIN_AREA && field.isDropdownField()) {
- field.setDropdownKeyValues(
- mAutofillProfileBridge.getAdminAreaDropdownList(adminAreas));
+ field.setDropdownKeyValues(mAutofillProfileBridge.getAdminAreaDropdownList(
+ adminAreaCodes, adminAreaNames));
}
// Libaddressinput formats do not always require the full name (RECIPIENT), but

Powered by Google App Engine
This is Rietveld 408576698