Index: ios/chrome/browser/ui/payments/payment_request_view_controller.h |
diff --git a/ios/chrome/browser/ui/payments/payment_request_view_controller.h b/ios/chrome/browser/ui/payments/payment_request_view_controller.h |
index 9aae684502455e905ee6e10aa01720389cd6412a..a7cf17574348872cf3793bda35bcadbe09d796ee 100644 |
--- a/ios/chrome/browser/ui/payments/payment_request_view_controller.h |
+++ b/ios/chrome/browser/ui/payments/payment_request_view_controller.h |
@@ -7,12 +7,24 @@ |
#import <UIKit/UIKit.h> |
+#include "ios/chrome/browser/payments/payment_request.h" |
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item.h" |
#import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" |
-#import "ios/chrome/browser/ui/payments/payment_request_view_controller_data_source.h" |
extern NSString* const kPaymentRequestCollectionViewID; |
+class PaymentRequest; |
+ |
@class PaymentRequestViewController; |
+ |
+// Data source protocol for PaymentRequestViewController. |
+@protocol PaymentRequestViewControllerDataSource<NSObject> |
+ |
+// Returns the authenticated account name, if a user is authenticated. |
+// Otherwise, returns nil. |
+- (NSString*)authenticatedAccountName; |
+ |
+@end |
// Delegate protocol for PaymentRequestViewController. |
@protocol PaymentRequestViewControllerDelegate<NSObject> |
@@ -54,7 +66,8 @@ |
// View controller responsible for presenting the details of a PaymentRequest to |
// the user and communicating their choices to the supplied delegate. |
-@interface PaymentRequestViewController : CollectionViewController |
+@interface PaymentRequestViewController |
+ : CollectionViewController<CollectionViewFooterLinkDelegate> |
// The favicon of the page invoking the Payment Request API. |
@property(nonatomic, strong) UIImage* pageFavicon; |
@@ -74,23 +87,37 @@ |
// The delegate to be notified when the user confirms or cancels the request. |
@property(nonatomic, weak) id<PaymentRequestViewControllerDelegate> delegate; |
-// The data source for this view controller. |
+// Whether the data source should be shown (usually until the first payment |
+// has been completed) or not. |
+@property(nonatomic, assign) BOOL showPaymentDataSource; |
+ |
@property(nonatomic, weak) id<PaymentRequestViewControllerDataSource> |
dataSource; |
-// Updates the payment summary item in the summary section. |
-- (void)updatePaymentSummaryItem; |
+// Updates the payment summary section UI. If |totalValueChanged| is YES, |
+// adds a label to the total amount item indicating that the total amount was |
+// updated. |
+- (void)updatePaymentSummaryWithTotalValueChanged:(BOOL)totalValueChanged; |
-// Updates the shipping section. |
-- (void)updateShippingSection; |
+// Updates the selected shipping address. |
+- (void)updateSelectedShippingAddressUI; |
-// Updates the payment method section. |
-- (void)updatePaymentMethodSection; |
+// Updates the selected shipping option. |
+- (void)updateSelectedShippingOptionUI; |
-// Updates the contact info section. |
-- (void)updateContactInfoSection; |
+// Updates the selected payment method. |
+- (void)updateSelectedPaymentMethodUI; |
-- (instancetype)init NS_DESIGNATED_INITIALIZER; |
+// Updates the selected contact info. |
+- (void)updateSelectedContactInfoUI; |
+ |
+// Initializes this object with an instance of PaymentRequest which has a copy |
+// of web::PaymentRequest as provided by the page invoking the Payment Request |
+// API. This object will not take ownership of |paymentRequest|. |
+- (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest |
+ NS_DESIGNATED_INITIALIZER; |
+ |
+- (instancetype)init NS_UNAVAILABLE; |
- (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
NS_UNAVAILABLE; |