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/content/browser/wallet/wallet_address.h" | 5 #include "components/autofill/content/browser/wallet/wallet_address.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "components/autofill/core/browser/autofill_country.h" | 11 #include "components/autofill/core/browser/autofill_country.h" |
12 #include "components/autofill/core/browser/autofill_profile.h" | 12 #include "components/autofill/core/browser/autofill_profile.h" |
| 13 #include "components/autofill/core/browser/autofill_type.h" |
13 #include "components/autofill/core/browser/state_names.h" | 14 #include "components/autofill/core/browser/state_names.h" |
14 | 15 |
15 namespace autofill { | 16 namespace autofill { |
16 namespace wallet { | 17 namespace wallet { |
17 | 18 |
18 // Server specified type for address with complete details. | 19 // Server specified type for address with complete details. |
19 const char kFullAddress[] = "FULL"; | 20 const char kFullAddress[] = "FULL"; |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 255 |
255 string16 Address::DisplayNameDetail() const { | 256 string16 Address::DisplayNameDetail() const { |
256 #if defined(OS_ANDROID) | 257 #if defined(OS_ANDROID) |
257 // TODO(aruslan): improve this stub implementation. | 258 // TODO(aruslan): improve this stub implementation. |
258 return address_line_1(); | 259 return address_line_1(); |
259 #else | 260 #else |
260 return string16(); | 261 return string16(); |
261 #endif | 262 #endif |
262 } | 263 } |
263 | 264 |
264 string16 Address::GetInfo(AutofillFieldType type, | 265 string16 Address::GetInfo(const AutofillType& type, |
265 const std::string& app_locale) const { | 266 const std::string& app_locale) const { |
266 switch (AutofillType::GetEquivalentFieldType(type)) { | 267 switch (AutofillType::GetEquivalentFieldType(type.server_type())) { |
267 case NAME_FULL: | 268 case NAME_FULL: |
268 return recipient_name(); | 269 return recipient_name(); |
269 | 270 |
270 case ADDRESS_HOME_LINE1: | 271 case ADDRESS_HOME_LINE1: |
271 return address_line_1(); | 272 return address_line_1(); |
272 | 273 |
273 case ADDRESS_HOME_LINE2: | 274 case ADDRESS_HOME_LINE2: |
274 return address_line_2(); | 275 return address_line_2(); |
275 | 276 |
276 case ADDRESS_HOME_CITY: | 277 case ADDRESS_HOME_CITY: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 bool Address::operator==(const Address& other) const { | 313 bool Address::operator==(const Address& other) const { |
313 return object_id_ == other.object_id_ && EqualsIgnoreID(other); | 314 return object_id_ == other.object_id_ && EqualsIgnoreID(other); |
314 } | 315 } |
315 | 316 |
316 bool Address::operator!=(const Address& other) const { | 317 bool Address::operator!=(const Address& other) const { |
317 return !(*this == other); | 318 return !(*this == other); |
318 } | 319 } |
319 | 320 |
320 } // namespace wallet | 321 } // namespace wallet |
321 } // namespace autofill | 322 } // namespace autofill |
OLD | NEW |