| 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 #import "ios/chrome/browser/ui/payments/payment_request_coordinator.h" | 5 #import "ios/chrome/browser/ui/payments/payment_request_coordinator.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "components/autofill/core/browser/autofill_profile.h" | 8 #include "components/autofill/core/browser/autofill_profile.h" |
| 9 #include "components/autofill/core/browser/credit_card.h" | 9 #include "components/autofill/core/browser/credit_card.h" |
| 10 #include "components/payments/core/payment_address.h" | 10 #include "components/payments/core/payment_address.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 - (void)fullCardRequestDidSucceedWithCard:(const autofill::CreditCard&)card | 106 - (void)fullCardRequestDidSucceedWithCard:(const autofill::CreditCard&)card |
| 107 verificationCode: | 107 verificationCode: |
| 108 (const base::string16&)verificationCode { | 108 (const base::string16&)verificationCode { |
| 109 _viewController.view.userInteractionEnabled = NO; | 109 _viewController.view.userInteractionEnabled = NO; |
| 110 [_viewController setPending:YES]; | 110 [_viewController setPending:YES]; |
| 111 [_viewController loadModel]; | 111 [_viewController loadModel]; |
| 112 [[_viewController collectionView] reloadData]; | 112 [[_viewController collectionView] reloadData]; |
| 113 | 113 |
| 114 [_delegate paymentRequestCoordinator:self | 114 [_delegate paymentRequestCoordinator:self |
| 115 didCompletePaymentRequest:_paymentRequest | 115 didCompletePaymentRequestWithCard:card |
| 116 card:card | 116 verificationCode:verificationCode]; |
| 117 verificationCode:verificationCode]; | |
| 118 } | 117 } |
| 119 | 118 |
| 120 - (void)updatePaymentDetails:(web::PaymentDetails)paymentDetails { | 119 - (void)updatePaymentDetails:(web::PaymentDetails)paymentDetails { |
| 121 BOOL totalValueChanged = | 120 BOOL totalValueChanged = |
| 122 (_paymentRequest->payment_details().total != paymentDetails.total); | 121 (_paymentRequest->payment_details().total != paymentDetails.total); |
| 123 _paymentRequest->UpdatePaymentDetails(paymentDetails); | 122 _paymentRequest->UpdatePaymentDetails(paymentDetails); |
| 124 | 123 |
| 125 if (_paymentRequest->shipping_options().empty()) { | 124 if (_paymentRequest->shipping_options().empty()) { |
| 126 // Display error in the shipping address/option selection view. | 125 // Display error in the shipping address/option selection view. |
| 127 if (_shippingAddressSelectionCoordinator) { | 126 if (_shippingAddressSelectionCoordinator) { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 - (void)paymentMethodSelectionCoordinatorDidReturn: | 316 - (void)paymentMethodSelectionCoordinatorDidReturn: |
| 318 (PaymentMethodSelectionCoordinator*)coordinator { | 317 (PaymentMethodSelectionCoordinator*)coordinator { |
| 319 // Clear the 'Updated' label on the payment summary item, if there is one. | 318 // Clear the 'Updated' label on the payment summary item, if there is one. |
| 320 [_viewController updatePaymentSummaryWithTotalValueChanged:NO]; | 319 [_viewController updatePaymentSummaryWithTotalValueChanged:NO]; |
| 321 | 320 |
| 322 [_methodSelectionCoordinator stop]; | 321 [_methodSelectionCoordinator stop]; |
| 323 _methodSelectionCoordinator = nil; | 322 _methodSelectionCoordinator = nil; |
| 324 } | 323 } |
| 325 | 324 |
| 326 @end | 325 @end |
| OLD | NEW |