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; | 5 package org.chromium.chrome.browser.payments; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
9 import android.os.Handler; | 9 import android.os.Handler; |
10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 } | 695 } |
696 } | 696 } |
697 | 697 |
698 /** | 698 /** |
699 * Called after retrieving instrument details. | 699 * Called after retrieving instrument details. |
700 */ | 700 */ |
701 @Override | 701 @Override |
702 public void onInstrumentDetailsReady(String methodName, String stringifiedDe
tails) { | 702 public void onInstrumentDetailsReady(String methodName, String stringifiedDe
tails) { |
703 PaymentResponse response = new PaymentResponse(); | 703 PaymentResponse response = new PaymentResponse(); |
704 response.methodName = methodName; | 704 response.methodName = methodName; |
705 response.totalAmount = mRawTotal.amount; | |
706 response.stringifiedDetails = stringifiedDetails; | 705 response.stringifiedDetails = stringifiedDetails; |
707 | 706 |
708 if (mContactSection != null) { | 707 if (mContactSection != null) { |
709 PaymentOption selectedContact = mContactSection.getSelectedItem(); | 708 PaymentOption selectedContact = mContactSection.getSelectedItem(); |
710 if (selectedContact != null) { | 709 if (selectedContact != null) { |
711 // Contacts are created in show(). These should all be instances
of AutofillContact. | 710 // Contacts are created in show(). These should all be instances
of AutofillContact. |
712 assert selectedContact instanceof AutofillContact; | 711 assert selectedContact instanceof AutofillContact; |
713 response.payerEmail = ((AutofillContact) selectedContact).getPay
erEmail(); | 712 response.payerEmail = ((AutofillContact) selectedContact).getPay
erEmail(); |
714 response.payerPhone = ((AutofillContact) selectedContact).getPay
erPhone(); | 713 response.payerPhone = ((AutofillContact) selectedContact).getPay
erPhone(); |
715 } | 714 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 private void closeClient() { | 778 private void closeClient() { |
780 if (mClient != null) mClient.close(); | 779 if (mClient != null) mClient.close(); |
781 mClient = null; | 780 mClient = null; |
782 } | 781 } |
783 | 782 |
784 @VisibleForTesting | 783 @VisibleForTesting |
785 public static void setObserverForTest(PaymentRequestServiceObserverForTest o
bserverForTest) { | 784 public static void setObserverForTest(PaymentRequestServiceObserverForTest o
bserverForTest) { |
786 sObserverForTest = observerForTest; | 785 sObserverForTest = observerForTest; |
787 } | 786 } |
788 } | 787 } |
OLD | NEW |