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

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

Issue 2733953003: [Payments] Return a basic card response (Closed)
Patch Set: addressed comments from anthony Created 3 years, 9 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
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/payments/payment_request_manager.h" 5 #import "ios/chrome/browser/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"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/strings/sys_string_conversions.h" 12 #include "base/strings/sys_string_conversions.h"
13 #import "base/values.h" 13 #import "base/values.h"
14 #include "components/autofill/core/browser/autofill_manager.h" 14 #include "components/autofill/core/browser/autofill_manager.h"
15 #include "components/autofill/core/browser/personal_data_manager.h" 15 #include "components/autofill/core/browser/personal_data_manager.h"
16 #include "components/autofill/ios/browser/autofill_driver_ios.h" 16 #include "components/autofill/ios/browser/autofill_driver_ios.h"
17 #include "components/payments/core/payment_address.h"
17 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h" 18 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
18 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 19 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
19 #import "ios/chrome/browser/payments/js_payment_request_manager.h" 20 #import "ios/chrome/browser/payments/js_payment_request_manager.h"
20 #include "ios/chrome/browser/payments/payment_request.h" 21 #include "ios/chrome/browser/payments/payment_request.h"
21 #import "ios/chrome/browser/payments/payment_request_coordinator.h" 22 #import "ios/chrome/browser/payments/payment_request_coordinator.h"
22 #include "ios/chrome/browser/procedural_block_types.h" 23 #include "ios/chrome/browser/procedural_block_types.h"
23 #include "ios/web/public/favicon_status.h" 24 #include "ios/web/public/favicon_status.h"
24 #include "ios/web/public/navigation_item.h" 25 #include "ios/web/public/navigation_item.h"
25 #include "ios/web/public/navigation_manager.h" 26 #include "ios/web/public/navigation_manager.h"
26 #include "ios/web/public/payments/payment_request.h" 27 #include "ios/web/public/payments/payment_request.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator 543 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
543 didConfirmWithPaymentResponse:(web::PaymentResponse)paymentResponse { 544 didConfirmWithPaymentResponse:(web::PaymentResponse)paymentResponse {
544 [_paymentRequestJsManager 545 [_paymentRequestJsManager
545 resolveRequestPromiseWithPaymentResponse:paymentResponse 546 resolveRequestPromiseWithPaymentResponse:paymentResponse
546 completionHandler:nil]; 547 completionHandler:nil];
547 [self setUnblockEventQueueTimer]; 548 [self setUnblockEventQueueTimer];
548 [self setPaymentResponseTimeoutTimer]; 549 [self setPaymentResponseTimeoutTimer];
549 } 550 }
550 551
551 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator 552 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
552 didSelectShippingAddress:(web::PaymentAddress)shippingAddress { 553 didSelectShippingAddress:(payments::PaymentAddress)shippingAddress {
553 [_paymentRequestJsManager updateShippingAddress:shippingAddress 554 [_paymentRequestJsManager updateShippingAddress:shippingAddress
554 completionHandler:nil]; 555 completionHandler:nil];
555 [self setUnblockEventQueueTimer]; 556 [self setUnblockEventQueueTimer];
556 [self setUpdateEventTimeoutTimer]; 557 [self setUpdateEventTimeoutTimer];
557 } 558 }
558 559
559 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator 560 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
560 didSelectShippingOption:(web::PaymentShippingOption)shippingOption { 561 didSelectShippingOption:(web::PaymentShippingOption)shippingOption {
561 [_paymentRequestJsManager updateShippingOption:shippingOption 562 [_paymentRequestJsManager updateShippingOption:shippingOption
562 completionHandler:nil]; 563 completionHandler:nil];
563 [self setUnblockEventQueueTimer]; 564 [self setUnblockEventQueueTimer];
564 [self setUpdateEventTimeoutTimer]; 565 [self setUpdateEventTimeoutTimer];
565 } 566 }
566 567
567 #pragma mark - CRWWebStateObserver methods 568 #pragma mark - CRWWebStateObserver methods
568 569
569 - (void)webState:(web::WebState*)webState 570 - (void)webState:(web::WebState*)webState
570 didCommitNavigationWithDetails: 571 didCommitNavigationWithDetails:
571 (const web::LoadCommittedDetails&)load_details { 572 (const web::LoadCommittedDetails&)load_details {
572 [self dismissUI]; 573 [self dismissUI];
573 _isScriptInjected = NO; 574 _isScriptInjected = NO;
574 [self enableCurrentWebState]; 575 [self enableCurrentWebState];
575 [self initializeWebViewForPaymentRequest]; 576 [self initializeWebViewForPaymentRequest];
576 } 577 }
577 578
578 @end 579 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698