| 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 #include "modules/payments/PaymentAddress.h" | 5 #include "modules/payments/PaymentAddress.h" |
| 6 | 6 |
| 7 #include "wtf/text/StringBuilder.h" |
| 8 |
| 7 namespace blink { | 9 namespace blink { |
| 8 | 10 |
| 9 PaymentAddress::PaymentAddress(mojom::blink::PaymentAddressPtr address) | 11 PaymentAddress::PaymentAddress(mojom::blink::PaymentAddressPtr address) |
| 10 : m_country(address->country) | 12 : m_country(address->country) |
| 11 , m_addressLine(address->address_line.PassStorage()) | 13 , m_addressLine(address->address_line.PassStorage()) |
| 12 , m_region(address->region) | 14 , m_region(address->region) |
| 13 , m_city(address->city) | 15 , m_city(address->city) |
| 14 , m_dependentLocality(address->dependent_locality) | 16 , m_dependentLocality(address->dependent_locality) |
| 15 , m_postalCode(address->postal_code) | 17 , m_postalCode(address->postal_code) |
| 16 , m_sortingCode(address->sorting_code) | 18 , m_sortingCode(address->sorting_code) |
| 17 , m_languageCode(address->language_code) | 19 , m_languageCode(address->language_code) |
| 18 , m_organization(address->organization) | 20 , m_organization(address->organization) |
| 19 , m_recipient(address->recipient) | 21 , m_recipient(address->recipient) |
| 20 , m_careOf(address->careOf) | 22 , m_careOf(address->careOf) |
| 21 , m_phone(address->phone) | 23 , m_phone(address->phone) |
| 22 { | 24 { |
| 23 if (!m_languageCode.isEmpty() && !address->script_code.isEmpty()) { | 25 if (!m_languageCode.isEmpty() && !address->script_code.isEmpty()) { |
| 24 m_languageCode.append("-"); | 26 StringBuilder builder; |
| 25 m_languageCode.append(address->script_code); | 27 builder.append(m_languageCode); |
| 28 builder.append('-'); |
| 29 builder.append(address->script_code); |
| 30 m_languageCode = builder.toString(); |
| 26 } | 31 } |
| 27 } | 32 } |
| 28 | 33 |
| 29 PaymentAddress::~PaymentAddress() {} | 34 PaymentAddress::~PaymentAddress() {} |
| 30 | 35 |
| 31 } // namespace blink | 36 } // namespace blink |
| OLD | NEW |