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

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

Issue 1945643003: Revert of Android integration tests for PaymentRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@address-in-result
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/autofill/CardUnmaskPrompt.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java
index 2ba79ea64404d1204aab48d88344dcf5f90a99e2..4230f6b02c6b7566e00e8227b720790342795830 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java
@@ -34,7 +34,6 @@
import android.widget.TextView;
import org.chromium.base.ApiCompatibilityUtils;
-import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
import java.util.Calendar;
@@ -44,17 +43,12 @@
*/
public class CardUnmaskPrompt
implements DialogInterface.OnDismissListener, TextWatcher, OnClickListener {
- /**
- * The number of milliseconds to display "Card verified" message.
- */
- private static final int SHOW_RESULT_DELAY_MS = 1000;
-
- private static CardUnmaskPrompt sCurrentPromptForTest;
-
private final CardUnmaskPromptDelegate mDelegate;
private final AlertDialog mDialog;
+ private boolean mShouldRequestExpirationDate;
private final int mThisYear;
private final int mThisMonth;
+
private final View mMainView;
private final TextView mInstructions;
private final TextView mNoRetryErrorMessage;
@@ -66,15 +60,11 @@
private final TextView mErrorMessage;
private final CheckBox mStoreLocallyCheckbox;
private final ImageView mStoreLocallyTooltipIcon;
+ private PopupWindow mStoreLocallyTooltipPopup;
private final ViewGroup mControlsContainer;
private final View mVerificationOverlay;
private final ProgressBar mVerificationProgressBar;
private final TextView mVerificationView;
- private final Runnable mDismissCallback;
-
- private boolean mShouldRequestExpirationDate;
- private PopupWindow mStoreLocallyTooltipPopup;
- private int mShowResultDelayMs = SHOW_RESULT_DELAY_MS;
/**
* An interface to handle the interaction with an CardUnmaskPrompt object.
@@ -108,29 +98,11 @@
void onNewCardLinkClicked();
}
- public static CardUnmaskPrompt create(Context context, CardUnmaskPromptDelegate delegate,
- String title, String instructions, String confirmButtonLabel, int drawableId,
+ public CardUnmaskPrompt(Context context, CardUnmaskPromptDelegate delegate, String title,
+ String instructions, String confirmButtonLabel, int drawableId,
boolean shouldRequestExpirationDate, boolean canStoreLocally,
boolean defaultToStoringLocally) {
- assert sCurrentPromptForTest == null;
- CardUnmaskPrompt prompt = new CardUnmaskPrompt(context, delegate, title, instructions,
- confirmButtonLabel, drawableId, shouldRequestExpirationDate, canStoreLocally,
- defaultToStoringLocally, new Runnable() {
- @Override
- public void run() {
- sCurrentPromptForTest = null;
- }
- });
- sCurrentPromptForTest = prompt;
- return prompt;
- }
-
- private CardUnmaskPrompt(Context context, CardUnmaskPromptDelegate delegate, String title,
- String instructions, String confirmButtonLabel, int drawableId,
- boolean shouldRequestExpirationDate, boolean canStoreLocally,
- boolean defaultToStoringLocally, Runnable dismissCallback) {
mDelegate = delegate;
- mDismissCallback = dismissCallback;
LayoutInflater inflater = LayoutInflater.from(context);
View v = inflater.inflate(R.layout.autofill_card_unmask_prompt, null);
@@ -243,13 +215,12 @@
public void run() {
dismiss();
}
- }, mShowResultDelayMs);
+ }, 1000);
}
}
@Override
public void onDismiss(DialogInterface dialog) {
- mDismissCallback.run();
mDelegate.dismissed();
}
@@ -468,19 +439,4 @@
return -1;
}
}
-
- @VisibleForTesting
- public static CardUnmaskPrompt getCurrentPromptForTest() {
- return sCurrentPromptForTest;
- }
-
- @VisibleForTesting
- public AlertDialog getDialogForTest() {
- return mDialog;
- }
-
- @VisibleForTesting
- public void setShowResultDelayForTest(int ms) {
- mShowResultDelayMs = ms;
- }
}

Powered by Google App Engine
This is Rietveld 408576698