| 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_REQUEST_UTIL_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_UTIL_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_UTIL_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_UTIL_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 | 11 |
| 12 namespace autofill { | 12 namespace autofill { |
| 13 class AutofillProfile; | 13 class AutofillProfile; |
| 14 class CreditCard; | 14 class CreditCard; |
| 15 } // namespace autofill | 15 } // namespace autofill |
| 16 | 16 |
| 17 namespace web { | 17 namespace web { |
| 18 class BasicCardResponse; | 18 class BasicCardResponse; |
| 19 class PaymentAddress; | 19 class PaymentAddress; |
| 20 } // namespace web | 20 } // namespace web |
| 21 | 21 |
| 22 class PaymentRequest; | 22 class PaymentRequest; |
| 23 | 23 |
| 24 namespace payment_request_util { | 24 namespace payment_request_util { |
| 25 | 25 |
| 26 // Helper function to get the name label from an autofill profile. Returns nil | 26 // Helper function to create a name label from an autofill profile. Returns nil |
| 27 // if the name field is empty. | 27 // if the resulting label is empty. |
| 28 NSString* GetNameLabelFromAutofillProfile( | 28 NSString* GetNameLabelFromAutofillProfile( |
| 29 const autofill::AutofillProfile& profile); | 29 const autofill::AutofillProfile& profile); |
| 30 | 30 |
| 31 // Helper function to get the address label from an autofill profile. Returns | 31 // Helper function to create a shipping address label from an autofill profile. |
| 32 // nil if the address field is empty. | 32 // Returns nil if the resulting label is empty. |
| 33 NSString* GetAddressLabelFromAutofillProfile( | 33 NSString* GetShippingAddressLabelFromAutofillProfile( |
| 34 const autofill::AutofillProfile& profile); | 34 const autofill::AutofillProfile& profile); |
| 35 | 35 |
| 36 // Helper function to get the phone number label from an autofill profile. | 36 // Helper function to create a billing address label from an autofill profile. |
| 37 // Returns nil if the phone number field is empty. | 37 // Returns nil if the resulting label is empty. |
| 38 NSString* GetBillingAddressLabelFromAutofillProfile( |
| 39 const autofill::AutofillProfile& profile); |
| 40 |
| 41 // Helper function to create a phone number label from an autofill profile. |
| 42 // Returns nil if the resulting label is empty. |
| 38 NSString* GetPhoneNumberLabelFromAutofillProfile( | 43 NSString* GetPhoneNumberLabelFromAutofillProfile( |
| 39 const autofill::AutofillProfile& profile); | 44 const autofill::AutofillProfile& profile); |
| 40 | 45 |
| 41 // Helper function to get the email label from an autofill profile. Returns nil | 46 // Helper function to create an email label from an autofill profile. Returns |
| 42 // if the email field is empty. | 47 // nil if the resulting label is empty. |
| 43 NSString* GetEmailLabelFromAutofillProfile( | 48 NSString* GetEmailLabelFromAutofillProfile( |
| 44 const autofill::AutofillProfile& profile); | 49 const autofill::AutofillProfile& profile); |
| 45 | 50 |
| 46 // Helper function to get an instance of web::PaymentAddress from an autofill | 51 // Helper function to get an instance of web::PaymentAddress from an autofill |
| 47 // profile. | 52 // profile. |
| 48 web::PaymentAddress GetPaymentAddressFromAutofillProfile( | 53 web::PaymentAddress GetPaymentAddressFromAutofillProfile( |
| 49 const autofill::AutofillProfile& profile); | 54 const autofill::AutofillProfile& profile); |
| 50 | 55 |
| 51 // Helper function to get an instance of web::BasicCardResponse from an autofill | 56 // Helper function to get an instance of web::BasicCardResponse from an autofill |
| 52 // credit card. | 57 // credit card. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 79 NSString* GetShippingOptionSelectorTitle(const PaymentRequest& payment_request); | 84 NSString* GetShippingOptionSelectorTitle(const PaymentRequest& payment_request); |
| 80 | 85 |
| 81 // Returns the error message to be displayed in the shipping option selection | 86 // Returns the error message to be displayed in the shipping option selection |
| 82 // view given the shipping type specified in |payment_request|. | 87 // view given the shipping type specified in |payment_request|. |
| 83 NSString* GetShippingOptionSelectorErrorMessage( | 88 NSString* GetShippingOptionSelectorErrorMessage( |
| 84 const PaymentRequest& payment_request); | 89 const PaymentRequest& payment_request); |
| 85 | 90 |
| 86 } // namespace payment_request_util | 91 } // namespace payment_request_util |
| 87 | 92 |
| 88 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_UTIL_H_ | 93 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_UTIL_H_ |
| OLD | NEW |