| 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 | 575 |
| 576 if (section == mShippingAddressSection) { | 576 if (section == mShippingAddressSection) { |
| 577 mClient.onSectionAddOption(TYPE_SHIPPING_ADDRESSES); | 577 mClient.onSectionAddOption(TYPE_SHIPPING_ADDRESSES); |
| 578 } else if (section == mContactDetailsSection) { | 578 } else if (section == mContactDetailsSection) { |
| 579 mClient.onSectionAddOption(TYPE_CONTACT_DETAILS); | 579 mClient.onSectionAddOption(TYPE_CONTACT_DETAILS); |
| 580 } else if (section == mPaymentMethodSection) { | 580 } else if (section == mPaymentMethodSection) { |
| 581 mClient.onSectionAddOption(TYPE_PAYMENT_METHODS); | 581 mClient.onSectionAddOption(TYPE_PAYMENT_METHODS); |
| 582 } | 582 } |
| 583 } | 583 } |
| 584 | 584 |
| 585 /** @return The editor user interface. */ | 585 /** |
| 586 public EditorView getEditorView() { | 586 * Displays the editor user interface for the given model. |
| 587 return mEditorView; | 587 * |
| 588 * @param editorModel The description of the editor user interface to displa
y. |
| 589 */ |
| 590 public void showEditor(final EditorModel editorModel) { |
| 591 mEditorView.show(editorModel); |
| 588 } | 592 } |
| 589 | 593 |
| 590 /** | 594 /** |
| 591 * Called when user clicks anything in the dialog. | 595 * Called when user clicks anything in the dialog. |
| 592 */ | 596 */ |
| 593 @Override | 597 @Override |
| 594 public void onClick(View v) { | 598 public void onClick(View v) { |
| 595 if (!isAcceptingCloseButton()) return; | 599 if (!isAcceptingCloseButton()) return; |
| 596 | 600 |
| 597 if (v == mCloseButton) { | 601 if (v == mCloseButton) { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 public static void setObserverForTest(PaymentRequestObserverForTest observer
ForTest) { | 1009 public static void setObserverForTest(PaymentRequestObserverForTest observer
ForTest) { |
| 1006 sObserverForTest = observerForTest; | 1010 sObserverForTest = observerForTest; |
| 1007 } | 1011 } |
| 1008 | 1012 |
| 1009 @VisibleForTesting | 1013 @VisibleForTesting |
| 1010 public Dialog getDialogForTest() { | 1014 public Dialog getDialogForTest() { |
| 1011 return mDialog; | 1015 return mDialog; |
| 1012 } | 1016 } |
| 1013 | 1017 |
| 1014 @VisibleForTesting | 1018 @VisibleForTesting |
| 1019 public Dialog getEditorViewForTest() { |
| 1020 return mEditorView; |
| 1021 } |
| 1022 |
| 1023 @VisibleForTesting |
| 1015 public ViewGroup getShippingAddressSectionForTest() { | 1024 public ViewGroup getShippingAddressSectionForTest() { |
| 1016 return mShippingAddressSection; | 1025 return mShippingAddressSection; |
| 1017 } | 1026 } |
| 1018 | 1027 |
| 1019 @VisibleForTesting | 1028 @VisibleForTesting |
| 1020 public ViewGroup getContactDetailsSectionForTest() { | 1029 public ViewGroup getContactDetailsSectionForTest() { |
| 1021 return mContactDetailsSection; | 1030 return mContactDetailsSection; |
| 1022 } | 1031 } |
| 1023 | 1032 |
| 1024 private void notifyReadyForInput() { | 1033 private void notifyReadyForInput() { |
| 1025 if (sObserverForTest != null && isAcceptingUserInput()) { | 1034 if (sObserverForTest != null && isAcceptingUserInput()) { |
| 1026 sObserverForTest.onPaymentRequestReadyForInput(this); | 1035 sObserverForTest.onPaymentRequestReadyForInput(this); |
| 1027 } | 1036 } |
| 1028 } | 1037 } |
| 1029 | 1038 |
| 1030 private void notifyReadyToPay() { | 1039 private void notifyReadyToPay() { |
| 1031 if (sObserverForTest != null && isAcceptingUserInput() && mPayButton.isE
nabled()) { | 1040 if (sObserverForTest != null && isAcceptingUserInput() && mPayButton.isE
nabled()) { |
| 1032 sObserverForTest.onPaymentRequestReadyToPay(this); | 1041 sObserverForTest.onPaymentRequestReadyToPay(this); |
| 1033 } | 1042 } |
| 1034 } | 1043 } |
| 1035 | 1044 |
| 1036 private void notifyReadyToClose() { | 1045 private void notifyReadyToClose() { |
| 1037 if (sObserverForTest != null && isAcceptingCloseButton()) { | 1046 if (sObserverForTest != null && isAcceptingCloseButton()) { |
| 1038 sObserverForTest.onPaymentRequestReadyToClose(this); | 1047 sObserverForTest.onPaymentRequestReadyToClose(this); |
| 1039 } | 1048 } |
| 1040 } | 1049 } |
| 1041 } | 1050 } |
| OLD | NEW |