| OLD | NEW |
| 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 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_ITEMS_DISPLAY_VIEW_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_ITEMS_DISPLAY_VIEW_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_ITEMS_DISPLAY_VIEW_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_ITEMS_DISPLAY_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ios/chrome/browser/payments/payment_request.h" | 11 #include "ios/chrome/browser/payments/payment_request.h" |
| 12 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" | 12 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" |
| 13 #include "ios/web/public/payments/payment_request.h" | 13 #include "ios/web/public/payments/payment_request.h" |
| 14 | 14 |
| 15 // The accessibility identifiers of the cells in the collection view. | 15 // The accessibility identifiers of the cells in the collection view. |
| 16 extern NSString* const kPaymentItemsDisplayItemId; | 16 extern NSString* const kPaymentItemsDisplayItemID; |
| 17 | 17 |
| 18 @class PaymentItemsDisplayViewController; | 18 @class PaymentItemsDisplayViewController; |
| 19 | 19 |
| 20 // Delegate protocol for PaymentItemsDisplayViewController. | 20 // Delegate protocol for PaymentItemsDisplayViewController. |
| 21 @protocol PaymentItemsDisplayViewControllerDelegate<NSObject> | 21 @protocol PaymentItemsDisplayViewControllerDelegate<NSObject> |
| 22 | 22 |
| 23 // Notifies the delegate that the user has chosen to return to the previous | 23 // Notifies the delegate that the user has chosen to return to the previous |
| 24 // screen. | 24 // screen. |
| 25 - (void)paymentItemsDisplayViewControllerDidReturn: | 25 - (void)paymentItemsDisplayViewControllerDidReturn: |
| 26 (PaymentItemsDisplayViewController*)controller; | 26 (PaymentItemsDisplayViewController*)controller; |
| 27 | 27 |
| 28 // Notifies the delegate that the user has confirmed the payment. | 28 // Notifies the delegate that the user has confirmed the payment. |
| 29 - (void)paymentItemsDisplayViewControllerDidConfirm: | 29 - (void)paymentItemsDisplayViewControllerDidConfirm: |
| 30 (PaymentItemsDisplayViewController*)controller; | 30 (PaymentItemsDisplayViewController*)controller; |
| 31 | 31 |
| 32 @end | 32 @end |
| 33 | 33 |
| 34 // View controller responsible for presenting the payment items from the payment | 34 // View controller responsible for presenting the payment items from the payment |
| 35 // request. The payment items are the line items that should sum to the total | 35 // request. The payment items are the line items that should sum to the total |
| 36 // payment (e.g. individual goods/services, tax, shipping). | 36 // payment (e.g. individual goods/services, tax, shipping). |
| 37 @interface PaymentItemsDisplayViewController : CollectionViewController | 37 @interface PaymentItemsDisplayViewController : CollectionViewController |
| 38 | 38 |
| 39 // The delegate to be notified when the user selects touches the return button | 39 // The delegate to be notified when the user selects touches the return button |
| 40 // or the pay button. | 40 // or the pay button. |
| 41 @property(nonatomic, weak) id<PaymentItemsDisplayViewControllerDelegate> | 41 @property(nonatomic, weak) |
| 42 delegate; | 42 id<PaymentItemsDisplayViewControllerDelegate> delegate; |
| 43 | 43 |
| 44 // Initializes this object with an instance of PaymentRequest which owns an | 44 // Initializes this object with an instance of PaymentRequest which owns an |
| 45 // instance of web::PaymentRequest as provided by the page invoking the Payment | 45 // instance of web::PaymentRequest as provided by the page invoking the Payment |
| 46 // Request API. This object will not take ownership of |paymentRequest|. | 46 // Request API. This object will not take ownership of |paymentRequest|. |
| 47 - (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest | 47 - (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest |
| 48 payButtonEnabled:(BOOL)payButtonEnabled | 48 payButtonEnabled:(BOOL)payButtonEnabled |
| 49 NS_DESIGNATED_INITIALIZER; | 49 NS_DESIGNATED_INITIALIZER; |
| 50 | 50 |
| 51 - (instancetype)init NS_UNAVAILABLE; | 51 - (instancetype)init NS_UNAVAILABLE; |
| 52 | 52 |
| 53 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style | 53 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
| 54 NS_UNAVAILABLE; | 54 NS_UNAVAILABLE; |
| 55 | 55 |
| 56 @end | 56 @end |
| 57 | 57 |
| 58 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_ITEMS_DISPLAY_VIEW_CONTROLLER_H_ | 58 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_ITEMS_DISPLAY_VIEW_CONTROLLER_H_ |
| OLD | NEW |