OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/wallet/wallet_address.h" | 5 #include "components/autofill/browser/wallet/wallet_address.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "components/autofill/browser/autofill_country.h" | 10 #include "components/autofill/browser/autofill_country.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 dict->SetString("recipient_name", recipient_name_); | 207 dict->SetString("recipient_name", recipient_name_); |
208 dict->SetString("locality_name", locality_name_); | 208 dict->SetString("locality_name", locality_name_); |
209 dict->SetString("administrative_area_name", | 209 dict->SetString("administrative_area_name", |
210 administrative_area_name_); | 210 administrative_area_name_); |
211 dict->SetString("postal_code_number", postal_code_number_); | 211 dict->SetString("postal_code_number", postal_code_number_); |
212 | 212 |
213 return dict.Pass(); | 213 return dict.Pass(); |
214 } | 214 } |
215 | 215 |
216 string16 Address::DisplayName() const { | 216 string16 Address::DisplayName() const { |
217 #if defined(OS_ANDROID) | |
218 // TODO(aruslan): improve this stub implementation. | |
219 return recipient_name(); | |
220 #else | |
217 // TODO(estade): improve this stub implementation. | 221 // TODO(estade): improve this stub implementation. |
222 // TODO(estade): I18N. | |
Evan Stade
2013/03/14 01:00:39
technically, l10n.
aruslan
2013/03/14 17:35:41
Done.
| |
218 return recipient_name() + ASCIIToUTF16(", ") + address_line_1(); | 223 return recipient_name() + ASCIIToUTF16(", ") + address_line_1(); |
224 #endif | |
225 } | |
226 | |
227 string16 Address::DisplayNameLine2() const { | |
228 #if defined(OS_ANDROID) | |
229 // TODO(aruslan): improve this stub implementation. | |
230 return address_line_1(); | |
231 #else | |
232 return string16(); | |
233 #endif | |
219 } | 234 } |
220 | 235 |
221 string16 Address::GetInfo(AutofillFieldType type) const { | 236 string16 Address::GetInfo(AutofillFieldType type) const { |
222 switch (type) { | 237 switch (type) { |
223 case NAME_FULL: | 238 case NAME_FULL: |
224 return recipient_name(); | 239 return recipient_name(); |
225 | 240 |
226 case ADDRESS_HOME_LINE1: | 241 case ADDRESS_HOME_LINE1: |
227 return address_line_1(); | 242 return address_line_1(); |
228 | 243 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 phone_number_ == other.phone_number_ && | 280 phone_number_ == other.phone_number_ && |
266 object_id_ == other.object_id_; | 281 object_id_ == other.object_id_; |
267 } | 282 } |
268 | 283 |
269 bool Address::operator!=(const Address& other) const { | 284 bool Address::operator!=(const Address& other) const { |
270 return !(*this == other); | 285 return !(*this == other); |
271 } | 286 } |
272 | 287 |
273 } // namespace wallet | 288 } // namespace wallet |
274 } // namespace autofill | 289 } // namespace autofill |
OLD | NEW |