| 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 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
| 6 | 6 |
| 7 #include "ios/chrome/browser/ui/payments/payment_request_mediator.h" | 7 #include "ios/chrome/browser/ui/payments/payment_request_mediator.h" |
| 8 | 8 |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 using ::payment_request_util::GetPhoneNumberLabelFromAutofillProfile; | 47 using ::payment_request_util::GetPhoneNumberLabelFromAutofillProfile; |
| 48 using ::payment_request_util::GetShippingAddressLabelFromAutofillProfile; | 48 using ::payment_request_util::GetShippingAddressLabelFromAutofillProfile; |
| 49 using ::payment_request_util::GetShippingSectionTitle; | 49 using ::payment_request_util::GetShippingSectionTitle; |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 @interface PaymentRequestMediator () | 52 @interface PaymentRequestMediator () |
| 53 | 53 |
| 54 // The PaymentRequest object owning an instance of web::PaymentRequest as | 54 // The PaymentRequest object owning an instance of web::PaymentRequest as |
| 55 // provided by the page invoking the Payment Request API. This is a weak | 55 // provided by the page invoking the Payment Request API. This is a weak |
| 56 // pointer and should outlive this class. | 56 // pointer and should outlive this class. |
| 57 @property(nonatomic, assign) PaymentRequest* paymentRequest; | 57 @property(nonatomic, assign) payments::PaymentRequest* paymentRequest; |
| 58 | 58 |
| 59 @end | 59 @end |
| 60 | 60 |
| 61 @implementation PaymentRequestMediator | 61 @implementation PaymentRequestMediator |
| 62 | 62 |
| 63 @synthesize totalValueChanged = _totalValueChanged; | 63 @synthesize totalValueChanged = _totalValueChanged; |
| 64 @synthesize paymentRequest = _paymentRequest; | 64 @synthesize paymentRequest = _paymentRequest; |
| 65 | 65 |
| 66 - (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest { | 66 - (instancetype)initWithPaymentRequest: |
| 67 (payments::PaymentRequest*)paymentRequest { |
| 67 self = [super init]; | 68 self = [super init]; |
| 68 if (self) { | 69 if (self) { |
| 69 _paymentRequest = paymentRequest; | 70 _paymentRequest = paymentRequest; |
| 70 } | 71 } |
| 71 return self; | 72 return self; |
| 72 } | 73 } |
| 73 | 74 |
| 74 #pragma mark - PaymentRequestViewControllerDataSource | 75 #pragma mark - PaymentRequestViewControllerDataSource |
| 75 | 76 |
| 76 - (BOOL)canPay { | 77 - (BOOL)canPay { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 } else { | 267 } else { |
| 267 item.text = l10n_util::GetNSString( | 268 item.text = l10n_util::GetNSString( |
| 268 IDS_PAYMENTS_CARD_AND_ADDRESS_SETTINGS_SIGNED_OUT); | 269 IDS_PAYMENTS_CARD_AND_ADDRESS_SETTINGS_SIGNED_OUT); |
| 269 } | 270 } |
| 270 } | 271 } |
| 271 item.linkURL = GURL(kSettingsURL); | 272 item.linkURL = GURL(kSettingsURL); |
| 272 return item; | 273 return item; |
| 273 } | 274 } |
| 274 | 275 |
| 275 @end | 276 @end |
| OLD | NEW |