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_UI_PAYMENTS_ADDRESS_EDIT_MEDIATOR_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_ADDRESS_EDIT_MEDIATOR_H_ |
6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_ADDRESS_EDIT_MEDIATOR_H_ | 6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_ADDRESS_EDIT_MEDIATOR_H_ |
7 | 7 |
8 #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller_dat
a_source.h" | 8 #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller_dat
a_source.h" |
| 9 #import "ios/chrome/browser/ui/payments/region_data_loader.h" |
9 | 10 |
10 class PaymentRequest; | 11 class PaymentRequest; |
11 @protocol PaymentRequestEditConsumer; | 12 @protocol PaymentRequestEditConsumer; |
12 | 13 |
13 namespace autofill { | 14 namespace autofill { |
14 class AutofillProfile; | 15 class AutofillProfile; |
15 } // namespace autofill | 16 } // namespace autofill |
16 | 17 |
17 // Serves as data source for AddressEditViewController. | 18 // Serves as data source for AddressEditViewController. |
18 @interface AddressEditMediator | 19 @interface AddressEditMediator |
19 : NSObject<PaymentRequestEditViewControllerDataSource> | 20 : NSObject<PaymentRequestEditViewControllerDataSource, |
| 21 RegionDataLoaderConsumer> |
20 | 22 |
21 // The consumer for this object. This can change during the lifetime of this | 23 // The consumer for this object. This can change during the lifetime of this |
22 // object and may be nil. | 24 // object and may be nil. |
23 @property(nonatomic, weak) id<PaymentRequestEditConsumer> consumer; | 25 @property(nonatomic, weak) id<PaymentRequestEditConsumer> consumer; |
24 | 26 |
| 27 // The map of country codes to country names. |
| 28 @property(nonatomic, strong) NSDictionary<NSString*, NSString*>* countries; |
| 29 |
| 30 // The country code for the currently selected country, if any. |
| 31 @property(nonatomic, strong) NSString* selectedCountryCode; |
| 32 |
| 33 // The list of region names used for the autofill::ADDRESS_HOME_STATE field. |
| 34 @property(nonatomic, strong) NSArray<NSString*>* regions; |
| 35 |
25 // Initializes this object with an instance of PaymentRequest which has a copy | 36 // Initializes this object with an instance of PaymentRequest which has a copy |
26 // of web::PaymentRequest as provided by the page invoking the Payment Request | 37 // of web::PaymentRequest as provided by the page invoking the Payment Request |
27 // API as well as |address| which is the address to be edited, if any. | 38 // API as well as |address| which is the address to be edited, if any. |
28 // This object will not take ownership of |paymentRequest| or |address|. | 39 // This object will not take ownership of |paymentRequest| or |address|. |
29 - (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest | 40 - (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest |
30 address:(autofill::AutofillProfile*)address | 41 address:(autofill::AutofillProfile*)address |
31 NS_DESIGNATED_INITIALIZER; | 42 NS_DESIGNATED_INITIALIZER; |
32 | 43 |
33 - (instancetype)init NS_UNAVAILABLE; | 44 - (instancetype)init NS_UNAVAILABLE; |
34 | 45 |
35 @end | 46 @end |
36 | 47 |
37 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_ADDRESS_EDIT_MEDIATOR_H_ | 48 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_ADDRESS_EDIT_MEDIATOR_H_ |
OLD | NEW |