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

Side by Side Diff: ios/chrome/browser/ui/payments/payment_request_manager.mm

Issue 2955263002: [Payment Request] Moves some of PR coordinator logic to PR manager (Closed)
Patch Set: Created 3 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
« no previous file with comments | « ios/chrome/browser/ui/payments/payment_request_coordinator_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "ios/chrome/browser/ui/payments/payment_request_manager.h" 5 #import "ios/chrome/browser/ui/payments/payment_request_manager.h"
6 6
7 #include "base/ios/block_types.h" 7 #include "base/ios/block_types.h"
8 #include "base/ios/ios_util.h" 8 #include "base/ios/ios_util.h"
9 #import "base/mac/bind_objc_block.h" 9 #import "base/mac/bind_objc_block.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 } 757 }
758 758
759 [_paymentRequestJsManager 759 [_paymentRequestJsManager
760 resolveRequestPromiseWithPaymentResponse:paymentResponse 760 resolveRequestPromiseWithPaymentResponse:paymentResponse
761 completionHandler:nil]; 761 completionHandler:nil];
762 [self setUnblockEventQueueTimer]; 762 [self setUnblockEventQueueTimer];
763 [self setPaymentResponseTimeoutTimer]; 763 [self setPaymentResponseTimeoutTimer];
764 } 764 }
765 765
766 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator 766 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
767 didSelectShippingAddress:(payments::PaymentAddress)shippingAddress { 767 didSelectShippingAddress:
768 [_paymentRequestJsManager updateShippingAddress:shippingAddress 768 (const autofill::AutofillProfile&)shippingAddress {
769 payments::PaymentAddress address =
770 payments::data_util::GetPaymentAddressFromAutofillProfile(
771 shippingAddress, GetApplicationContext()->GetApplicationLocale());
772 [_paymentRequestJsManager updateShippingAddress:address
769 completionHandler:nil]; 773 completionHandler:nil];
770 [self setUnblockEventQueueTimer]; 774 [self setUnblockEventQueueTimer];
771 [self setUpdateEventTimeoutTimer]; 775 [self setUpdateEventTimeoutTimer];
772 } 776 }
773 777
774 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator 778 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
775 didSelectShippingOption:(web::PaymentShippingOption)shippingOption { 779 didSelectShippingOption:
780 (const web::PaymentShippingOption&)shippingOption {
776 [_paymentRequestJsManager updateShippingOption:shippingOption 781 [_paymentRequestJsManager updateShippingOption:shippingOption
777 completionHandler:nil]; 782 completionHandler:nil];
778 [self setUnblockEventQueueTimer]; 783 [self setUnblockEventQueueTimer];
779 [self setUpdateEventTimeoutTimer]; 784 [self setUpdateEventTimeoutTimer];
780 } 785 }
781 786
782 #pragma mark - CRWWebStateObserver methods 787 #pragma mark - CRWWebStateObserver methods
783 788
784 - (void)webState:(web::WebState*)webState 789 - (void)webState:(web::WebState*)webState
785 didCommitNavigationWithDetails: 790 didCommitNavigationWithDetails:
786 (const web::LoadCommittedDetails&)load_details { 791 (const web::LoadCommittedDetails&)load_details {
787 [self dismissUI]; 792 [self dismissUI];
788 [self enableCurrentWebState]; 793 [self enableCurrentWebState];
789 } 794 }
790 795
791 @end 796 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/payments/payment_request_coordinator_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698