| Index: ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
|
| diff --git a/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm b/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
|
| index 9abf8dc0034f9bcfecfe0b1d8c2cfc3bd2c77d86..726a4ff11ceea88ed1c9cd431afb7ab0033d8a2f 100644
|
| --- a/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
|
| +++ b/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
|
| @@ -11,6 +11,7 @@
|
| #include "components/strings/grit/components_strings.h"
|
| #import "ios/chrome/browser/payments/cells/payments_text_item.h"
|
| #include "ios/chrome/browser/payments/payment_request.h"
|
| +#import "ios/chrome/browser/payments/shipping_option_selection_view_controller_actions.h"
|
| #import "ios/chrome/browser/ui/autofill/cells/status_item.h"
|
| #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
|
| #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
|
| @@ -29,8 +30,8 @@
|
| #error "This file requires ARC support."
|
| #endif
|
|
|
| -NSString* const kShippingOptionSelectionCollectionViewId =
|
| - @"kShippingOptionSelectionCollectionViewId";
|
| +NSString* const kShippingOptionSelectionCollectionViewID =
|
| + @"kShippingOptionSelectionCollectionViewID";
|
|
|
| namespace {
|
|
|
| @@ -48,9 +49,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
|
|
|
| } // namespace
|
|
|
| -@interface ShippingOptionSelectionViewController () {
|
| - __weak id<ShippingOptionSelectionViewControllerDelegate> _delegate;
|
| -
|
| +@interface ShippingOptionSelectionViewController ()<
|
| + ShippingOptionSelectionViewControllerActions> {
|
| // The PaymentRequest object owning an instance of web::PaymentRequest as
|
| // provided by the page invoking the Payment Request API. This is a weak
|
| // pointer and should outlive this class.
|
| @@ -60,15 +60,13 @@ typedef NS_ENUM(NSInteger, ItemType) {
|
| CollectionViewTextItem* _selectedItem;
|
| }
|
|
|
| -// Called when the user presses the return button.
|
| -- (void)onReturn;
|
| -
|
| @end
|
|
|
| @implementation ShippingOptionSelectionViewController
|
|
|
| @synthesize isLoading = _isLoading;
|
| @synthesize errorMessage = _errorMessage;
|
| +@synthesize delegate = _delegate;
|
|
|
| - (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest {
|
| DCHECK(paymentRequest);
|
| @@ -76,6 +74,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
|
| self.title = l10n_util::GetNSString(
|
| IDS_IOS_PAYMENT_REQUEST_SHIPPING_OPTION_SELECTION_TITLE);
|
|
|
| + // Set up leading (return) button.
|
| UIBarButtonItem* returnButton =
|
| [ChromeIcon templateBarButtonItemWithImage:[ChromeIcon backIcon]
|
| target:nil
|
| @@ -88,15 +87,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
|
| return self;
|
| }
|
|
|
| -- (id<ShippingOptionSelectionViewControllerDelegate>)delegate {
|
| - return _delegate;
|
| -}
|
| -
|
| -- (void)setDelegate:
|
| - (id<ShippingOptionSelectionViewControllerDelegate>)delegate {
|
| - _delegate = delegate;
|
| -}
|
| -
|
| - (void)onReturn {
|
| [_delegate shippingOptionSelectionViewControllerDidReturn:self];
|
| }
|
| @@ -156,7 +146,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
|
| - (void)viewDidLoad {
|
| [super viewDidLoad];
|
| self.collectionView.accessibilityIdentifier =
|
| - kShippingOptionSelectionCollectionViewId;
|
| + kShippingOptionSelectionCollectionViewID;
|
|
|
| // Customize collection view settings.
|
| self.styler.cellStyle = MDCCollectionViewCellStyleCard;
|
|
|