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

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

Issue 2092083003: Refactor contact editor controller into its own class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Match payments UI size even on large screens. Created 4 years, 5 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 /** 585 /** @return The editor user interface. */
586 * Displays the editor user interface for the given model. 586 public EditorView getEditorView() {
587 * 587 return mEditorView;
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);
592 } 588 }
593 589
594 /** 590 /**
595 * Called when user clicks anything in the dialog. 591 * Called when user clicks anything in the dialog.
596 */ 592 */
597 @Override 593 @Override
598 public void onClick(View v) { 594 public void onClick(View v) {
599 if (!isAcceptingCloseButton()) return; 595 if (!isAcceptingCloseButton()) return;
600 596
601 if (v == mCloseButton) { 597 if (v == mCloseButton) {
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 public static void setObserverForTest(PaymentRequestObserverForTest observer ForTest) { 1005 public static void setObserverForTest(PaymentRequestObserverForTest observer ForTest) {
1010 sObserverForTest = observerForTest; 1006 sObserverForTest = observerForTest;
1011 } 1007 }
1012 1008
1013 @VisibleForTesting 1009 @VisibleForTesting
1014 public Dialog getDialogForTest() { 1010 public Dialog getDialogForTest() {
1015 return mDialog; 1011 return mDialog;
1016 } 1012 }
1017 1013
1018 @VisibleForTesting 1014 @VisibleForTesting
1019 public Dialog getEditorViewForTest() {
1020 return mEditorView;
1021 }
1022
1023 @VisibleForTesting
1024 public ViewGroup getShippingAddressSectionForTest() { 1015 public ViewGroup getShippingAddressSectionForTest() {
1025 return mShippingAddressSection; 1016 return mShippingAddressSection;
1026 } 1017 }
1027 1018
1028 @VisibleForTesting 1019 @VisibleForTesting
1029 public ViewGroup getContactDetailsSectionForTest() { 1020 public ViewGroup getContactDetailsSectionForTest() {
1030 return mContactDetailsSection; 1021 return mContactDetailsSection;
1031 } 1022 }
1032 1023
1033 private void notifyReadyForInput() { 1024 private void notifyReadyForInput() {
1034 if (sObserverForTest != null && isAcceptingUserInput()) { 1025 if (sObserverForTest != null && isAcceptingUserInput()) {
1035 sObserverForTest.onPaymentRequestReadyForInput(this); 1026 sObserverForTest.onPaymentRequestReadyForInput(this);
1036 } 1027 }
1037 } 1028 }
1038 1029
1039 private void notifyReadyToPay() { 1030 private void notifyReadyToPay() {
1040 if (sObserverForTest != null && isAcceptingUserInput() && mPayButton.isE nabled()) { 1031 if (sObserverForTest != null && isAcceptingUserInput() && mPayButton.isE nabled()) {
1041 sObserverForTest.onPaymentRequestReadyToPay(this); 1032 sObserverForTest.onPaymentRequestReadyToPay(this);
1042 } 1033 }
1043 } 1034 }
1044 1035
1045 private void notifyReadyToClose() { 1036 private void notifyReadyToClose() {
1046 if (sObserverForTest != null && isAcceptingCloseButton()) { 1037 if (sObserverForTest != null && isAcceptingCloseButton()) {
1047 sObserverForTest.onPaymentRequestReadyToClose(this); 1038 sObserverForTest.onPaymentRequestReadyToClose(this);
1048 } 1039 }
1049 } 1040 }
1050 } 1041 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698