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

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

Issue 1927143003: Require explicit user action for shipping address. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/ui/PaymentRequestUI.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
index 1903d9b201541edbe7bc5b4c60e74ceddee9ae5b..a6c68890bd2ca4fa74ab4519cc50949a15302cb4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
@@ -240,18 +240,27 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
if (mRequestShipping) {
mShippingAddressesSection = result.getShippingAddresses();
- String selectedAddressLabel = result.getSelectedShippingAddressLabel();
- if (selectedAddressLabel != null) {
- mShippingSummaryAddress.setText(selectedAddressLabel);
- }
-
mShippingOptionsSection = result.getShippingOptions();
+
+ String selectedAddressLabel = result.getSelectedShippingAddressLabel();
String selectedShippingOptionLabel = result.getSelectedShippingOptionLabel();
- if (selectedShippingOptionLabel != null) {
- mShippingSummaryOption.setText(selectedShippingOptionLabel);
+ if (selectedAddressLabel == null && selectedShippingOptionLabel == null) {
+ mShippingSummaryAddress.setText(mContext.getString(
+ R.string.payments_select_shipping_prompt));
} else {
- mShippingSummaryOption.setText(mContext.getString(
- R.string.payments_select_shipping_option_prompt));
+ if (selectedAddressLabel == null) {
+ mShippingSummaryAddress.setText(mContext.getString(
+ R.string.payments_select_shipping_address_prompt));
+ } else {
+ mShippingSummaryAddress.setText(selectedAddressLabel);
+ }
+
+ if (selectedShippingOptionLabel == null) {
+ mShippingSummaryOption.setText(mContext.getString(
+ R.string.payments_select_shipping_option_prompt));
+ } else {
+ mShippingSummaryOption.setText(selectedShippingOptionLabel);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698