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

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

Issue 851783002: Fix deprecation warnings in Android autofill profile editor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java
index 782b2af3876e69ad9e665ea146e69ad192ddaca8..ce69ae098bcdd9bfb081506686314d6ed4f8658c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java
@@ -111,15 +111,15 @@ public class AutofillProfileEditor extends Fragment implements TextWatcher,
mEmailText.setText(profile.getEmailAddress());
mLanguageCodeString = profile.getLanguageCode();
- address.set(AddressField.ADMIN_AREA, profile.getRegion());
- address.set(AddressField.LOCALITY, profile.getLocality());
- address.set(AddressField.RECIPIENT, profile.getFullName());
- address.set(AddressField.ORGANIZATION, profile.getCompanyName());
- address.set(AddressField.DEPENDENT_LOCALITY, profile.getDependentLocality());
- address.set(AddressField.POSTAL_CODE, profile.getPostalCode());
- address.set(AddressField.SORTING_CODE, profile.getSortingCode());
- address.set(AddressField.ADDRESS_LINE_1, profile.getStreetAddress());
- address.set(AddressField.COUNTRY, profile.getCountryCode());
+ address.setAdminArea(profile.getRegion());
+ address.setLocality(profile.getLocality());
+ address.setRecipient(profile.getFullName());
+ address.setOrganization(profile.getCompanyName());
+ address.setDependentLocality(profile.getDependentLocality());
+ address.setPostalCode(profile.getPostalCode());
+ address.setSortingCode(profile.getSortingCode());
+ address.setAddress(profile.getStreetAddress());
+ address.setCountry(profile.getCountryCode());
}
ViewGroup widgetRoot = (ViewGroup) v.findViewById(R.id.autofill_profile_widget_root);
@@ -138,17 +138,12 @@ public class AutofillProfileEditor extends Fragment implements TextWatcher,
// Ignore empty fields.
private void saveProfile() {
AddressData input = mAddressWidget.getAddressData();
- String addressLines = input.getAddressLine1();
- if (!TextUtils.isEmpty(input.getAddressLine2())) {
- addressLines += "\n" + input.getAddressLine2();
- }
-
AutofillProfile profile = new PersonalDataManager.AutofillProfile(
mGUID,
AutofillPreferences.SETTINGS_ORIGIN,
input.getRecipient(),
input.getOrganization(),
- addressLines,
+ TextUtils.join("\n", input.getAddressLines()),
input.getAdministrativeArea(),
input.getLocality(),
input.getDependentLocality(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698