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

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

Issue 2708933003: [Payments] Add timeout to the address_normalizer. (Closed)
Patch Set: Created 3 years, 10 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/AutofillPaymentInstrument.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillPaymentInstrument.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillPaymentInstrument.java
index ef0826e2c614f41cd8c2d3605e9acc50c5043263..3bb77ec3164c0b6ce5210184b42ddd2657d1026c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillPaymentInstrument.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillPaymentInstrument.java
@@ -5,7 +5,6 @@
package org.chromium.chrome.browser.payments;
import android.content.Context;
-import android.os.Handler;
import android.text.TextUtils;
import android.util.JsonWriter;
@@ -100,8 +99,9 @@ public class AutofillPaymentInstrument extends PaymentInstrument
mIsWaitingForFullCardDetails = true;
// Start the billing address normalization.
- PersonalDataManager.getInstance().normalizeAddress(
- mBillingAddress.getGUID(), AutofillAddress.getCountryCode(mBillingAddress), this);
+ PersonalDataManager.getInstance().normalizeAddress(mBillingAddress.getGUID(),
+ AutofillAddress.getCountryCode(mBillingAddress),
+ PersonalDataManager.getInstance().getNormalizationTimeoutSeconds(), this);
// Start to get the full card details.
PersonalDataManager.getInstance().getFullCard(mWebContents, mCard, this);
@@ -126,20 +126,9 @@ public class AutofillPaymentInstrument extends PaymentInstrument
mCallback.onInstrumentDetailsLoadingWithoutUI();
// Wait for the billing address normalization before sending the instrument details.
- if (mIsWaitingForBillingNormalization) {
- // If the normalization is not completed yet, Start a timer to cancel it if it takes too
- // long.
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- onAddressNormalized(null);
- }
- }, PersonalDataManager.getInstance().getNormalizationTimeoutMS());
+ if (mIsWaitingForBillingNormalization) return;
please use gerrit instead 2017/02/21 17:15:12 Collapse 3 lines into 1: if (!mIsWaitingForBillin
sebsg 2017/02/21 18:30:59 Done.
- return;
- } else {
- sendIntrumentDetails();
- }
+ sendIntrumentDetails();
Mathieu 2017/02/21 17:40:43 Instrument?
sebsg 2017/02/21 18:30:59 Done.
}
@Override

Powered by Google App Engine
This is Rietveld 408576698