OLD | NEW |
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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 * <li>Successfully processing the payment.</li> | 391 * <li>Successfully processing the payment.</li> |
392 * <li>Failure to process the payment.</li> | 392 * <li>Failure to process the payment.</li> |
393 * <li>The JavaScript calling the abort() method in PaymentRequest API.</li
> | 393 * <li>The JavaScript calling the abort() method in PaymentRequest API.</li
> |
394 * <li>The PaymentRequest JavaScript object being destroyed.</li> | 394 * <li>The PaymentRequest JavaScript object being destroyed.</li> |
395 * </ul> | 395 * </ul> |
396 * | 396 * |
397 * Does not call Client.onDismissed(). | 397 * Does not call Client.onDismissed(). |
398 * | 398 * |
399 * Should not be called multiple times. | 399 * Should not be called multiple times. |
400 * | 400 * |
401 * @param paymentSuccess Whether the payment (if any) was successful. | 401 * @param shouldCloseImmediately If true, this function will immediately dis
miss the dialog |
| 402 * without describing the error. |
402 * @param callback The callback to notify of finished animations. | 403 * @param callback The callback to notify of finished animations. |
403 */ | 404 */ |
404 public void close(boolean paymentSuccess, final Runnable callback) { | 405 public void close(boolean shouldCloseImmediately, final Runnable callback) { |
405 mIsClientClosing = true; | 406 mIsClientClosing = true; |
406 mResultView.update(paymentSuccess, new Runnable() { | 407 mResultView.update(shouldCloseImmediately, new Runnable() { |
407 @Override | 408 @Override |
408 public void run() { | 409 public void run() { |
409 dismissDialog(false); | 410 dismissDialog(false); |
410 if (callback != null) callback.run(); | 411 if (callback != null) callback.run(); |
411 } | 412 } |
412 }); | 413 }); |
413 if (sObserverForTest != null) sObserverForTest.onPaymentRequestResultRea
dy(this); | 414 if (sObserverForTest != null) sObserverForTest.onPaymentRequestResultRea
dy(this); |
414 } | 415 } |
415 | 416 |
416 /** | 417 /** |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 sObserverForTest.onPaymentRequestReadyToPay(this); | 935 sObserverForTest.onPaymentRequestReadyToPay(this); |
935 } | 936 } |
936 } | 937 } |
937 | 938 |
938 private void notifyReadyToClose() { | 939 private void notifyReadyToClose() { |
939 if (sObserverForTest != null && isAcceptingCloseButton()) { | 940 if (sObserverForTest != null && isAcceptingCloseButton()) { |
940 sObserverForTest.onPaymentRequestReadyToClose(this); | 941 sObserverForTest.onPaymentRequestReadyToClose(this); |
941 } | 942 } |
942 } | 943 } |
943 } | 944 } |
OLD | NEW |