| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/core/browser/address.h" | 5 #include "components/autofill/core/browser/address.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 case ADDRESS_HOME_ZIP: | 64 case ADDRESS_HOME_ZIP: |
| 65 return zip_code_; | 65 return zip_code_; |
| 66 | 66 |
| 67 case ADDRESS_HOME_SORTING_CODE: | 67 case ADDRESS_HOME_SORTING_CODE: |
| 68 return sorting_code_; | 68 return sorting_code_; |
| 69 | 69 |
| 70 case ADDRESS_HOME_COUNTRY: | 70 case ADDRESS_HOME_COUNTRY: |
| 71 return base::ASCIIToUTF16(country_code_); | 71 return base::ASCIIToUTF16(country_code_); |
| 72 | 72 |
| 73 case ADDRESS_HOME_STREET_ADDRESS: | 73 case ADDRESS_HOME_STREET_ADDRESS: |
| 74 return base::JoinString(street_address_, base::ASCIIToUTF16("\n")); | 74 return JoinString(street_address_, '\n'); |
| 75 | 75 |
| 76 default: | 76 default: |
| 77 NOTREACHED(); | 77 NOTREACHED(); |
| 78 return base::string16(); | 78 return base::string16(); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 void Address::SetRawInfo(ServerFieldType type, const base::string16& value) { | 82 void Address::SetRawInfo(ServerFieldType type, const base::string16& value) { |
| 83 DCHECK_EQ(ADDRESS_HOME, AutofillType(type).group()); | 83 DCHECK_EQ(ADDRESS_HOME, AutofillType(type).group()); |
| 84 switch (type) { | 84 switch (type) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 supported_types->insert(ADDRESS_HOME_COUNTRY); | 211 supported_types->insert(ADDRESS_HOME_COUNTRY); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void Address::TrimStreetAddress() { | 214 void Address::TrimStreetAddress() { |
| 215 while (!street_address_.empty() && street_address_.back().empty()) { | 215 while (!street_address_.empty() && street_address_.back().empty()) { |
| 216 street_address_.pop_back(); | 216 street_address_.pop_back(); |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace autofill | 220 } // namespace autofill |
| OLD | NEW |