| 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 if (selectedShippingAddress != null) { | 669 if (selectedShippingAddress != null) { |
| 670 // Shipping addresses are created in show(). The should all be insta
nces of | 670 // Shipping addresses are created in show(). The should all be insta
nces of |
| 671 // AutofillAddress. | 671 // AutofillAddress. |
| 672 assert selectedShippingAddress instanceof AutofillAddress; | 672 assert selectedShippingAddress instanceof AutofillAddress; |
| 673 response.shippingAddress = | 673 response.shippingAddress = |
| 674 ((AutofillAddress) selectedShippingAddress).toPaymentAddress
(); | 674 ((AutofillAddress) selectedShippingAddress).toPaymentAddress
(); |
| 675 } | 675 } |
| 676 | 676 |
| 677 PaymentOption selectedShippingOption = mUiShippingOptions.getSelectedIte
m(); | 677 PaymentOption selectedShippingOption = mUiShippingOptions.getSelectedIte
m(); |
| 678 if (selectedShippingOption != null && selectedShippingOption.getIdentifi
er() != null) { | 678 if (selectedShippingOption != null && selectedShippingOption.getIdentifi
er() != null) { |
| 679 response.shippingOptionId = selectedShippingOption.getIdentifier(); | 679 response.shippingOption = selectedShippingOption.getIdentifier(); |
| 680 } | 680 } |
| 681 | 681 |
| 682 mClient.onPaymentResponse(response); | 682 mClient.onPaymentResponse(response); |
| 683 } | 683 } |
| 684 | 684 |
| 685 /** | 685 /** |
| 686 * Called if unable to retrieve instrument details. | 686 * Called if unable to retrieve instrument details. |
| 687 */ | 687 */ |
| 688 @Override | 688 @Override |
| 689 public void onInstrumentDetailsError() { | 689 public void onInstrumentDetailsError() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 private void closeClient() { | 725 private void closeClient() { |
| 726 if (mClient != null) mClient.close(); | 726 if (mClient != null) mClient.close(); |
| 727 mClient = null; | 727 mClient = null; |
| 728 } | 728 } |
| 729 | 729 |
| 730 @VisibleForTesting | 730 @VisibleForTesting |
| 731 public static void setObserverForTest(PaymentRequestServiceObserverForTest o
bserverForTest) { | 731 public static void setObserverForTest(PaymentRequestServiceObserverForTest o
bserverForTest) { |
| 732 sObserverForTest = observerForTest; | 732 sObserverForTest = observerForTest; |
| 733 } | 733 } |
| 734 } | 734 } |
| OLD | NEW |