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

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

Issue 2647573005: [Payments] Allow users enable and disable Android payment apps in payment request (Closed)
Patch Set: rename Created 3 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
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
index f282bc76ac34554686194736b208c72debeccb0f..3e20edbd2e7cbad1299f68b3dae43a7baacfc30e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -12,7 +12,6 @@ import android.support.v4.util.ArrayMap;
import android.text.TextUtils;
import org.chromium.base.Callback;
-import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.RecordHistogram;
@@ -167,7 +166,6 @@ public class PaymentRequestImpl
private static final String TAG = "cr_PaymentRequest";
private static final String ANDROID_PAY_METHOD_NAME = "https://android.com/pay";
- private static final String PAYMENT_COMPLETE_ONCE = "payment_complete_once";
private static final Comparator<Completable> COMPLETENESS_COMPARATOR =
new Comparator<Completable>() {
@Override
@@ -409,8 +407,8 @@ public class PaymentRequestImpl
mUI = new PaymentRequestUI(mContext, this, requestShipping,
requestPayerName || requestPayerPhone || requestPayerEmail,
- mMerchantSupportsAutofillPaymentInstruments, !isPaymentCompleteOnce(),
- mMerchantName, mOrigin,
+ mMerchantSupportsAutofillPaymentInstruments,
+ !PaymentPreferencesUtil.isPaymentCompleteOnce(), mMerchantName, mOrigin,
new ShippingStrings(
options == null ? PaymentShippingType.SHIPPING : options.shippingType));
@@ -1131,21 +1129,12 @@ public class PaymentRequestImpl
public void complete(int result) {
if (mClient == null) return;
recordSuccessFunnelHistograms("Completed");
- if (!isPaymentCompleteOnce()) setPaymentCompleteOnce();
+ if (!PaymentPreferencesUtil.isPaymentCompleteOnce()) {
+ PaymentPreferencesUtil.setPaymentCompleteOnce();
+ }
closeUI(PaymentComplete.FAIL != result);
}
- private static boolean isPaymentCompleteOnce() {
- return ContextUtils.getAppSharedPreferences().getBoolean(PAYMENT_COMPLETE_ONCE, false);
- }
-
- private static void setPaymentCompleteOnce() {
- ContextUtils.getAppSharedPreferences()
- .edit()
- .putBoolean(PAYMENT_COMPLETE_ONCE, true)
- .apply();
- }
-
@Override
public void onCardAndAddressSettingsClicked() {
Intent intent = PreferencesLauncher.createIntentForSettingsPage(

Powered by Google App Engine
This is Rietveld 408576698