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

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

Issue 1964323002: Reland: Test dismissing CVC prompt for PaymentRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.payments.ui; 5 package org.chromium.chrome.browser.payments.ui;
6 6
7 import android.animation.Animator; 7 import android.animation.Animator;
8 import android.animation.AnimatorListenerAdapter; 8 import android.animation.AnimatorListenerAdapter;
9 import android.animation.AnimatorSet; 9 import android.animation.AnimatorSet;
10 import android.animation.ObjectAnimator; 10 import android.animation.ObjectAnimator;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 * Called when clicks on the X close button are possible. 123 * Called when clicks on the X close button are possible.
124 */ 124 */
125 void onPaymentRequestReadyToClose(PaymentRequestUI ui); 125 void onPaymentRequestReadyToClose(PaymentRequestUI ui);
126 126
127 /** 127 /**
128 * Called when clicks on the PAY button are possible. 128 * Called when clicks on the PAY button are possible.
129 */ 129 */
130 void onPaymentRequestReadyToPay(PaymentRequestUI ui); 130 void onPaymentRequestReadyToPay(PaymentRequestUI ui);
131 131
132 /** 132 /**
133 * Called when the result UI is showing.
134 */
135 void onPaymentRequestResultReady(PaymentRequestUI ui);
136
137 /**
133 * Called when the UI is gone. 138 * Called when the UI is gone.
134 */ 139 */
135 void onPaymentRequestDismiss(); 140 void onPaymentRequestDismiss();
136 } 141 }
137 142
138 /** Length of the animation to either show the UI or expand it to full heigh t. */ 143 /** Length of the animation to either show the UI or expand it to full heigh t. */
139 private static final int DIALOG_ENTER_ANIMATION_MS = 225; 144 private static final int DIALOG_ENTER_ANIMATION_MS = 225;
140 145
141 /** Length of the animation to hide the bottom sheet UI. */ 146 /** Length of the animation to hide the bottom sheet UI. */
142 private static final int DIALOG_EXIT_ANIMATION_MS = 195; 147 private static final int DIALOG_EXIT_ANIMATION_MS = 195;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 */ 350 */
346 public void close(boolean paymentSuccess, final Runnable callback) { 351 public void close(boolean paymentSuccess, final Runnable callback) {
347 mIsClientClosing = true; 352 mIsClientClosing = true;
348 mResultUI.update(paymentSuccess, new Runnable() { 353 mResultUI.update(paymentSuccess, new Runnable() {
349 @Override 354 @Override
350 public void run() { 355 public void run() {
351 dismissDialog(false); 356 dismissDialog(false);
352 if (callback != null) callback.run(); 357 if (callback != null) callback.run();
353 } 358 }
354 }); 359 });
360 if (mObserverForTest != null) mObserverForTest.onPaymentRequestResultRea dy(this);
355 } 361 }
356 362
357 /** 363 /**
358 * Sets the icon in the top left of the UI. This can be, for example, the fa vicon of the 364 * Sets the icon in the top left of the UI. This can be, for example, the fa vicon of the
359 * merchant website. This is not a part of the constructor because favicon r etrieval is 365 * merchant website. This is not a part of the constructor because favicon r etrieval is
360 * asynchronous. 366 * asynchronous.
361 * 367 *
362 * @param bitmap The bitmap to show next to the title. 368 * @param bitmap The bitmap to show next to the title.
363 */ 369 */
364 public void setTitleBitmap(Bitmap bitmap) { 370 public void setTitleBitmap(Bitmap bitmap) {
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 mObserverForTest.onPaymentRequestReadyToPay(this); 785 mObserverForTest.onPaymentRequestReadyToPay(this);
780 } 786 }
781 } 787 }
782 788
783 private void notifyReadyToClose() { 789 private void notifyReadyToClose() {
784 if (mObserverForTest != null && isAcceptingCloseButton()) { 790 if (mObserverForTest != null && isAcceptingCloseButton()) {
785 mObserverForTest.onPaymentRequestReadyToClose(this); 791 mObserverForTest.onPaymentRequestReadyToClose(this);
786 } 792 }
787 } 793 }
788 } 794 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698