| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef IOS_CHROME_BROWSER_PAYMENTS_CREDIT_CARD_EDIT_VIEW_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_CREDIT_CARD_EDIT_VIEW_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_CREDIT_CARD_EDIT_VIEW_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_CREDIT_CARD_EDIT_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import "ios/chrome/browser/payments/payment_request_edit_view_controller.h" | 8 #import "ios/chrome/browser/payments/payment_request_edit_view_controller.h" |
| 9 | 9 |
| 10 @class EditorField; | 10 @class EditorField; |
| 11 @class CreditCardEditViewController; | 11 @class CreditCardEditViewController; |
| 12 | 12 |
| 13 typedef NS_ENUM(NSInteger, CreditCardEditViewControllerState) { | 13 typedef NS_ENUM(NSInteger, CreditCardEditViewControllerState) { |
| 14 // The view controller is used to create a new credit card. | 14 // The view controller is used to create a new credit card. |
| 15 CreditCardEditViewControllerStateCreate, | 15 CreditCardEditViewControllerStateCreate, |
| 16 // The view controller is used to edit a credit card. | 16 // The view controller is used to edit a credit card. |
| 17 CreditCardEditViewControllerStateEdit, | 17 CreditCardEditViewControllerStateEdit, |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 // Data source protocol for CreditCardEditViewController. | 20 // Data source protocol for CreditCardEditViewController. |
| 21 @protocol CreditCardEditViewControllerDataSource< | 21 @protocol CreditCardEditViewControllerDataSource< |
| 22 PaymentRequestEditViewControllerDataSource> | 22 PaymentRequestEditViewControllerDataSource> |
| 23 | 23 |
| 24 // Returns an item that identifies the server card being edited. Returns nil for | 24 // Returns an item that identifies the credit card being edited. May return nil. |
| 25 // local cards or when a card is being created. | |
| 26 - (CollectionViewItem*)serverCardSummaryItem; | 25 - (CollectionViewItem*)serverCardSummaryItem; |
| 27 | 26 |
| 27 // Returns an item that displays a list of payment method type icons for the |
| 28 // accepted payment methods. May return nil. |
| 29 - (CollectionViewItem*)acceptedPaymentMethodsItem; |
| 30 |
| 28 // Returns the billing address label from an autofill profile with the given | 31 // Returns the billing address label from an autofill profile with the given |
| 29 // guid. Returns nil if the profile does not have an address. | 32 // guid. Returns nil if the profile does not have an address. |
| 30 - (NSString*)billingAddressLabelForProfileWithGUID:(NSString*)profileGUID; | 33 - (NSString*)billingAddressLabelForProfileWithGUID:(NSString*)profileGUID; |
| 31 | 34 |
| 32 // Returns the credit card type icon corresponding to |cardNumber|. | 35 // Returns the credit card type icon corresponding to |cardNumber|. |
| 33 - (UIImage*)cardTypeIconFromCardNumber:(NSString*)cardNumber; | 36 - (UIImage*)cardTypeIconFromCardNumber:(NSString*)cardNumber; |
| 34 | 37 |
| 35 @end | 38 @end |
| 36 | 39 |
| 37 // Delegate protocol for CreditCardEditViewController. | 40 // Delegate protocol for CreditCardEditViewController. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 @property(nonatomic, assign) CreditCardEditViewControllerState state; | 76 @property(nonatomic, assign) CreditCardEditViewControllerState state; |
| 74 | 77 |
| 75 - (instancetype)init NS_DESIGNATED_INITIALIZER; | 78 - (instancetype)init NS_DESIGNATED_INITIALIZER; |
| 76 | 79 |
| 77 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style | 80 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
| 78 NS_UNAVAILABLE; | 81 NS_UNAVAILABLE; |
| 79 | 82 |
| 80 @end | 83 @end |
| 81 | 84 |
| 82 #endif // IOS_CHROME_BROWSER_PAYMENTS_CREDIT_CARD_EDIT_VIEW_CONTROLLER_H_ | 85 #endif // IOS_CHROME_BROWSER_PAYMENTS_CREDIT_CARD_EDIT_VIEW_CONTROLLER_H_ |
| OLD | NEW |