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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 * <li>Successfully processing the payment.</li> | 389 * <li>Successfully processing the payment.</li> |
390 * <li>Failure to process the payment.</li> | 390 * <li>Failure to process the payment.</li> |
391 * <li>The JavaScript calling the abort() method in PaymentRequest API.</li > | 391 * <li>The JavaScript calling the abort() method in PaymentRequest API.</li > |
392 * <li>The PaymentRequest JavaScript object being destroyed.</li> | 392 * <li>The PaymentRequest JavaScript object being destroyed.</li> |
393 * </ul> | 393 * </ul> |
394 * | 394 * |
395 * Does not call Client.onDismissed(). | 395 * Does not call Client.onDismissed(). |
396 * | 396 * |
397 * Should not be called multiple times. | 397 * Should not be called multiple times. |
398 * | 398 * |
399 * @param paymentSuccess Whether the payment (if any) was successful. | 399 * @param result Whether the payment (if any) was successful. |
400 * @param callback The callback to notify of finished animations. | 400 * @param callback The callback to notify of finished animations. |
401 */ | 401 */ |
402 public void close(boolean paymentSuccess, final Runnable callback) { | 402 public void close(int result, final Runnable callback) { |
please use gerrit instead
2016/06/10 19:15:35
Continue using a boolean.
| |
403 mIsClientClosing = true; | 403 mIsClientClosing = true; |
404 mResultView.update(paymentSuccess, new Runnable() { | 404 mResultView.update(result, new Runnable() { |
405 @Override | 405 @Override |
406 public void run() { | 406 public void run() { |
407 dismissDialog(false); | 407 dismissDialog(false); |
408 if (callback != null) callback.run(); | 408 if (callback != null) callback.run(); |
409 } | 409 } |
410 }); | 410 }); |
411 if (mObserverForTest != null) mObserverForTest.onPaymentRequestResultRea dy(this); | 411 if (mObserverForTest != null) mObserverForTest.onPaymentRequestResultRea dy(this); |
412 } | 412 } |
413 | 413 |
414 /** | 414 /** |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
894 mObserverForTest.onPaymentRequestReadyToPay(this); | 894 mObserverForTest.onPaymentRequestReadyToPay(this); |
895 } | 895 } |
896 } | 896 } |
897 | 897 |
898 private void notifyReadyToClose() { | 898 private void notifyReadyToClose() { |
899 if (mObserverForTest != null && isAcceptingCloseButton()) { | 899 if (mObserverForTest != null && isAcceptingCloseButton()) { |
900 mObserverForTest.onPaymentRequestReadyToClose(this); | 900 mObserverForTest.onPaymentRequestReadyToClose(this); |
901 } | 901 } |
902 } | 902 } |
903 } | 903 } |
OLD | NEW |