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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 string16 Address::DisplayNameDetail() const { | 227 string16 Address::DisplayNameDetail() const { |
228 #if defined(OS_ANDROID) | 228 #if defined(OS_ANDROID) |
229 // TODO(aruslan): improve this stub implementation. | 229 // TODO(aruslan): improve this stub implementation. |
230 return address_line_1(); | 230 return address_line_1(); |
231 #else | 231 #else |
232 return string16(); | 232 return string16(); |
233 #endif | 233 #endif |
234 } | 234 } |
235 | 235 |
236 string16 Address::GetInfo(AutofillFieldType type) const { | 236 string16 Address::GetInfo(AutofillFieldType type, |
| 237 const std::string& app_locale) const { |
237 switch (type) { | 238 switch (type) { |
238 case NAME_FULL: | 239 case NAME_FULL: |
239 return recipient_name(); | 240 return recipient_name(); |
240 | 241 |
241 case ADDRESS_HOME_LINE1: | 242 case ADDRESS_HOME_LINE1: |
242 return address_line_1(); | 243 return address_line_1(); |
243 | 244 |
244 case ADDRESS_HOME_LINE2: | 245 case ADDRESS_HOME_LINE2: |
245 return address_line_2(); | 246 return address_line_2(); |
246 | 247 |
247 case ADDRESS_HOME_CITY: | 248 case ADDRESS_HOME_CITY: |
248 return locality_name(); | 249 return locality_name(); |
249 | 250 |
250 case ADDRESS_HOME_STATE: | 251 case ADDRESS_HOME_STATE: |
251 return administrative_area_name(); | 252 return administrative_area_name(); |
252 | 253 |
253 case ADDRESS_HOME_ZIP: | 254 case ADDRESS_HOME_ZIP: |
254 return postal_code_number(); | 255 return postal_code_number(); |
255 | 256 |
256 case ADDRESS_HOME_COUNTRY: { | 257 case ADDRESS_HOME_COUNTRY: { |
257 AutofillCountry country(country_name_code(), | 258 AutofillCountry country(country_name_code(), app_locale); |
258 AutofillCountry::ApplicationLocale()); | |
259 return country.name(); | 259 return country.name(); |
260 } | 260 } |
261 | 261 |
262 case PHONE_HOME_WHOLE_NUMBER: | 262 case PHONE_HOME_WHOLE_NUMBER: |
263 return phone_number(); | 263 return phone_number(); |
264 | 264 |
265 // TODO(estade): implement more. | 265 // TODO(estade): implement more. |
266 default: | 266 default: |
267 NOTREACHED(); | 267 NOTREACHED(); |
268 return string16(); | 268 return string16(); |
(...skipping 11 matching lines...) Expand all Loading... |
280 phone_number_ == other.phone_number_ && | 280 phone_number_ == other.phone_number_ && |
281 object_id_ == other.object_id_; | 281 object_id_ == other.object_id_; |
282 } | 282 } |
283 | 283 |
284 bool Address::operator!=(const Address& other) const { | 284 bool Address::operator!=(const Address& other) const { |
285 return !(*this == other); | 285 return !(*this == other); |
286 } | 286 } |
287 | 287 |
288 } // namespace wallet | 288 } // namespace wallet |
289 } // namespace autofill | 289 } // namespace autofill |
OLD | NEW |