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

Unified Diff: ios/chrome/browser/payments/payment_method_selection_coordinator.mm

Issue 2744823003: [Payment Request] Generic edit form (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/payments/payment_method_selection_coordinator.mm
diff --git a/ios/chrome/browser/payments/payment_method_selection_coordinator.mm b/ios/chrome/browser/payments/payment_method_selection_coordinator.mm
index 5a1510834942243fa015262af92012d305a91655..1b5fc27397c2dfa1e040a4a69f9c57244af004e3 100644
--- a/ios/chrome/browser/payments/payment_method_selection_coordinator.mm
+++ b/ios/chrome/browser/payments/payment_method_selection_coordinator.mm
@@ -11,7 +11,9 @@
#error "This file requires ARC support."
#endif
-@interface PaymentMethodSelectionCoordinator ()
+@interface PaymentMethodSelectionCoordinator () {
+ CreditCardEditCoordinator* _creditCardEditCoordinator;
+}
@property(nonatomic, strong)
PaymentMethodSelectionViewController* viewController;
@@ -44,6 +46,7 @@
- (void)stop {
[[self baseViewController].navigationController
popViewControllerAnimated:YES];
+ _creditCardEditCoordinator = nil;
_viewController = nil;
}
@@ -79,4 +82,31 @@
});
}
+- (void)paymentMethodSelectionViewControllerDidSelectAddCard:
+ (PaymentMethodSelectionViewController*)controller {
+ _creditCardEditCoordinator = [[CreditCardEditCoordinator alloc]
+ initWithBaseViewController:[self baseViewController]];
+ [_creditCardEditCoordinator setPaymentRequest:_paymentRequest];
+ [_creditCardEditCoordinator setDelegate:self];
+ [_creditCardEditCoordinator start];
+}
+
+#pragma mark - CreditCardEditCoordinatorDelegate
+
+- (void)creditCardEditCoordinator:(CreditCardEditCoordinator*)coordinator
+ didFinishEditingCreditCard:(autofill::CreditCard*)creditCard {
+ [_creditCardEditCoordinator stop];
+ _creditCardEditCoordinator = nil;
+
+ // Inform |_delegate| that this card has been selected.
+ [_delegate paymentMethodSelectionCoordinator:self
+ didSelectPaymentMethod:creditCard];
+}
+
+- (void)creditCardEditCoordinatorDidReturn:
+ (CreditCardEditCoordinator*)coordinator {
+ [_creditCardEditCoordinator stop];
+ _creditCardEditCoordinator = nil;
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698