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 COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ |
6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ | 6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const std::string& country_code); | 59 const std::string& country_code); |
60 | 60 |
61 // Formats the given number |phone_number| to | 61 // Formats the given number |phone_number| to |
62 // i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::E164 format by using | 62 // i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::E164 format by using |
63 // i18n::phonenumbers::PhoneNumberUtil::Format, as defined in the Payment | 63 // i18n::phonenumbers::PhoneNumberUtil::Format, as defined in the Payment |
64 // Request spec | 64 // Request spec |
65 // (https://w3c.github.io/browser-payment-api/#paymentrequest-updated-algorithm) | 65 // (https://w3c.github.io/browser-payment-api/#paymentrequest-updated-algorithm) |
66 std::string FormatPhoneForResponse(const std::string& phone_number, | 66 std::string FormatPhoneForResponse(const std::string& phone_number, |
67 const std::string& country_code); | 67 const std::string& country_code); |
68 | 68 |
| 69 // Returns a country code to be used when validating this profile. If the |
| 70 // profile has a valid country code set, it is returned. If not, a country code |
| 71 // associated with |app_locale| is used as a fallback. |
| 72 std::string GetCountryCodeWithFallback(const autofill::AutofillProfile* profile, |
| 73 const std::string& app_locale); |
| 74 |
69 } // namespace data_util | 75 } // namespace data_util |
70 } // namespace payments | 76 } // namespace payments |
71 | 77 |
72 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ | 78 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_ |
OLD | NEW |