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/payments/payment_request_coordinator.h" | 5 #import "ios/chrome/browser/payments/payment_request_coordinator.h" |
6 | 6 |
7 #include <unordered_set> | 7 #include <unordered_set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 if (!card.billing_address_id().empty()) { | 197 if (!card.billing_address_id().empty()) { |
198 autofill::AutofillProfile* address = | 198 autofill::AutofillProfile* address = |
199 autofill::PersonalDataManager::GetProfileFromProfilesByGUID( | 199 autofill::PersonalDataManager::GetProfileFromProfilesByGUID( |
200 card.billing_address_id(), _paymentRequest->billing_profiles()); | 200 card.billing_address_id(), _paymentRequest->billing_profiles()); |
201 if (address) { | 201 if (address) { |
202 paymentResponse.details.billing_address = | 202 paymentResponse.details.billing_address = |
203 payment_request_util::PaymentAddressFromAutofillProfile(address); | 203 payment_request_util::PaymentAddressFromAutofillProfile(address); |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
| 207 _viewController.view.userInteractionEnabled = NO; |
| 208 [_viewController setPending:YES]; |
| 209 [_viewController loadModel]; |
| 210 [[_viewController collectionView] reloadData]; |
| 211 |
207 [_delegate paymentRequestCoordinator:self | 212 [_delegate paymentRequestCoordinator:self |
208 didConfirmWithPaymentResponse:paymentResponse]; | 213 didConfirmWithPaymentResponse:paymentResponse]; |
209 } | 214 } |
210 | 215 |
211 - (void)updatePaymentDetails:(web::PaymentDetails)paymentDetails { | 216 - (void)updatePaymentDetails:(web::PaymentDetails)paymentDetails { |
212 BOOL totalValueChanged = | 217 BOOL totalValueChanged = |
213 (_paymentRequest->payment_details().total != paymentDetails.total); | 218 (_paymentRequest->payment_details().total != paymentDetails.total); |
214 _paymentRequest->set_payment_details(paymentDetails); | 219 _paymentRequest->set_payment_details(paymentDetails); |
215 | 220 |
216 if (_paymentRequest->shipping_options().empty()) { | 221 if (_paymentRequest->shipping_options().empty()) { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 - (void)paymentMethodSelectionCoordinatorDidReturn: | 386 - (void)paymentMethodSelectionCoordinatorDidReturn: |
382 (PaymentMethodSelectionCoordinator*)coordinator { | 387 (PaymentMethodSelectionCoordinator*)coordinator { |
383 // Clear the 'Updated' label on the payment summary item, if there is one. | 388 // Clear the 'Updated' label on the payment summary item, if there is one. |
384 [_viewController updatePaymentSummaryWithTotalValueChanged:NO]; | 389 [_viewController updatePaymentSummaryWithTotalValueChanged:NO]; |
385 | 390 |
386 [_methodSelectionCoordinator stop]; | 391 [_methodSelectionCoordinator stop]; |
387 _methodSelectionCoordinator = nil; | 392 _methodSelectionCoordinator = nil; |
388 } | 393 } |
389 | 394 |
390 @end | 395 @end |
OLD | NEW |