OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_VIEW_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_VIEW_CONTROLLER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" |
| 11 #include "ios/web/public/payments/payment_request.h" |
| 12 |
| 13 namespace autofill { |
| 14 class AutofillProfile; |
| 15 class CreditCard; |
| 16 } |
| 17 |
| 18 @protocol PaymentRequestViewControllerDelegate<NSObject> |
| 19 - (void)paymentRequestViewControllerDidCancel; |
| 20 - (void)paymentRequestViewControllerDidConfirm; |
| 21 - (void)paymentRequestViewControllerDisplayPaymentItems; |
| 22 - (void)paymentRequestViewControllerSelectShippingAddress; |
| 23 - (void)paymentRequestViewControllerSelectPaymentMethod; |
| 24 |
| 25 @end |
| 26 |
| 27 // View controller responsible for presenting the details of a PaymentRequest to |
| 28 // the user and communicating their choices to the supplied delegate. |
| 29 @interface PaymentRequestViewController : CollectionViewController |
| 30 |
| 31 // The PaymentRequest object as provided by the page invoking the Payment |
| 32 // Request API. |
| 33 @property(nonatomic, assign) web::PaymentRequest paymentRequest; |
| 34 |
| 35 // The favicon of the page invoking the Payment Request API. |
| 36 @property(nonatomic, retain) UIImage* pageFavicon; |
| 37 |
| 38 // The title of the page invoking the Payment Request API. |
| 39 @property(nonatomic, copy) NSString* pageTitle; |
| 40 |
| 41 // The host of the page invoking the Payment Request API. |
| 42 @property(nonatomic, copy) NSString* pageHost; |
| 43 |
| 44 // The currently selected and displayed shipping address, if any. |
| 45 @property(nonatomic, assign) autofill::AutofillProfile* selectedShippingAddress; |
| 46 |
| 47 // The currently selected and displayed payment method, if any. |
| 48 @property(nonatomic, assign) autofill::CreditCard* selectedPaymentMethod; |
| 49 |
| 50 // The delegate to be notified when the user confirms or cancels the request. |
| 51 @property(nonatomic, weak) id<PaymentRequestViewControllerDelegate> delegate; |
| 52 |
| 53 // Sets the selected shipping address and updates the UI. |
| 54 - (void)updateSelectedShippingAddress: |
| 55 (autofill::AutofillProfile*)shippingAddress; |
| 56 |
| 57 - (instancetype)init NS_DESIGNATED_INITIALIZER; |
| 58 |
| 59 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
| 60 NS_UNAVAILABLE; |
| 61 |
| 62 @end |
| 63 |
| 64 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_VIEW_CONTROLLER_H_ |
OLD | NEW |