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

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

Issue 2515853002: [Payments] Fix new billing address label. (Closed)
Patch Set: Updated test and code added in the Rebase Created 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillAddress.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillAddress.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillAddress.java
index 4e1a5b3a6f835406006e4d9d6b6af5dd99860a62..4453c3e2ae10f0c8fe09867fd2ae8cadc91cf627 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillAddress.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillAddress.java
@@ -10,6 +10,7 @@ import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.autofill.PersonalDataManager;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
import org.chromium.chrome.browser.payments.ui.PaymentOption;
import org.chromium.chrome.browser.preferences.autofill.AutofillProfileBridge;
@@ -92,6 +93,31 @@ public class AutofillAddress extends PaymentOption {
assert mIsComplete;
}
+ /*
+ * Gets the shipping address label for the profile associated with this address and sets it as
+ * sublabel for this PaymentOption.
+ */
+ public void setShippingAddressLabel() {
+ assert mProfile != null;
+
+ mProfile.setLabel(
+ PersonalDataManager.getInstance().getShippingAddressLabelForPaymentRequest(
+ mProfile));
+ updateSublabel(mProfile.getLabel());
+ }
+
+ /*
+ * Gets the billing address label for the profile associated with this address and sets it as
+ * sublabel for this PaymentOption.
+ */
+ public void setBillingAddressLabel() {
+ assert mProfile != null;
+
+ mProfile.setLabel(PersonalDataManager.getInstance().getBillingAddressLabelForPaymentRequest(
+ mProfile));
+ updateSublabel(mProfile.getLabel());
+ }
+
/**
* Checks whether this address is complete and updates edit message, edit title and complete
* status.

Powered by Google App Engine
This is Rietveld 408576698