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 "chrome/browser/autofill/autofill_profile.h" | 5 #include "chrome/browser/autofill/autofill_profile.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 #include <ostream> | 10 #include <ostream> |
11 #include <set> | 11 #include <set> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/guid.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "base/string_util.h" | 16 #include "base/string_util.h" |
16 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
17 #include "chrome/browser/autofill/address.h" | 18 #include "chrome/browser/autofill/address.h" |
18 #include "chrome/browser/autofill/autofill_type.h" | 19 #include "chrome/browser/autofill/autofill_type.h" |
19 #include "chrome/browser/autofill/contact_info.h" | 20 #include "chrome/browser/autofill/contact_info.h" |
20 #include "chrome/browser/autofill/phone_number.h" | 21 #include "chrome/browser/autofill/phone_number.h" |
21 #include "chrome/browser/autofill/phone_number_i18n.h" | 22 #include "chrome/browser/autofill/phone_number_i18n.h" |
22 #include "chrome/common/guid.h" | |
23 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 // Like |AutofillType::GetEquivalentFieldType()|, but also returns |NAME_FULL| | 28 // Like |AutofillType::GetEquivalentFieldType()|, but also returns |NAME_FULL| |
29 // for first, middle, and last name field types. | 29 // for first, middle, and last name field types. |
30 AutofillFieldType GetEquivalentFieldTypeCollapsingNames( | 30 AutofillFieldType GetEquivalentFieldTypeCollapsingNames( |
31 AutofillFieldType field_type) { | 31 AutofillFieldType field_type) { |
32 if (field_type == NAME_FIRST || field_type == NAME_MIDDLE || | 32 if (field_type == NAME_FIRST || field_type == NAME_MIDDLE || |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } // namespace | 207 } // namespace |
208 | 208 |
209 AutofillProfile::AutofillProfile(const std::string& guid) | 209 AutofillProfile::AutofillProfile(const std::string& guid) |
210 : guid_(guid), | 210 : guid_(guid), |
211 name_(1), | 211 name_(1), |
212 email_(1), | 212 email_(1), |
213 home_number_(1, PhoneNumber(this)) { | 213 home_number_(1, PhoneNumber(this)) { |
214 } | 214 } |
215 | 215 |
216 AutofillProfile::AutofillProfile() | 216 AutofillProfile::AutofillProfile() |
217 : guid_(guid::GenerateGUID()), | 217 : guid_(base::GenerateGUID()), |
218 name_(1), | 218 name_(1), |
219 email_(1), | 219 email_(1), |
220 home_number_(1, PhoneNumber(this)) { | 220 home_number_(1, PhoneNumber(this)) { |
221 } | 221 } |
222 | 222 |
223 AutofillProfile::AutofillProfile(const AutofillProfile& profile) | 223 AutofillProfile::AutofillProfile(const AutofillProfile& profile) |
224 : FormGroup() { | 224 : FormGroup() { |
225 operator=(profile); | 225 operator=(profile); |
226 } | 226 } |
227 | 227 |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 << UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_CITY)) | 748 << UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_CITY)) |
749 << " " | 749 << " " |
750 << UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_STATE)) | 750 << UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_STATE)) |
751 << " " | 751 << " " |
752 << UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_ZIP)) | 752 << UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_ZIP)) |
753 << " " | 753 << " " |
754 << UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_COUNTRY)) | 754 << UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_COUNTRY)) |
755 << " " | 755 << " " |
756 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); | 756 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); |
757 } | 757 } |
OLD | NEW |