OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "app/l10n_util.h" | 13 #include "app/l10n_util.h" |
| 14 #include "base/guid.h" |
14 #include "base/stl_util-inl.h" | 15 #include "base/stl_util-inl.h" |
15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/autofill/address.h" | 17 #include "chrome/browser/autofill/address.h" |
17 #include "chrome/browser/autofill/autofill_manager.h" | 18 #include "chrome/browser/autofill/autofill_manager.h" |
18 #include "chrome/browser/autofill/contact_info.h" | 19 #include "chrome/browser/autofill/contact_info.h" |
19 #include "chrome/browser/autofill/fax_number.h" | 20 #include "chrome/browser/autofill/fax_number.h" |
20 #include "chrome/browser/autofill/home_address.h" | 21 #include "chrome/browser/autofill/home_address.h" |
21 #include "chrome/browser/autofill/home_phone_number.h" | 22 #include "chrome/browser/autofill/home_phone_number.h" |
22 #include "chrome/browser/guid.h" | |
23 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 void InitPersonalInfo(FormGroupMap* personal_info) { | 27 void InitPersonalInfo(FormGroupMap* personal_info) { |
28 (*personal_info)[AutoFillType::CONTACT_INFO] = new ContactInfo(); | 28 (*personal_info)[AutoFillType::CONTACT_INFO] = new ContactInfo(); |
29 (*personal_info)[AutoFillType::PHONE_HOME] = new HomePhoneNumber(); | 29 (*personal_info)[AutoFillType::PHONE_HOME] = new HomePhoneNumber(); |
30 (*personal_info)[AutoFillType::PHONE_FAX] = new FaxNumber(); | 30 (*personal_info)[AutoFillType::PHONE_FAX] = new FaxNumber(); |
31 (*personal_info)[AutoFillType::ADDRESS_HOME] = new HomeAddress(); | 31 (*personal_info)[AutoFillType::ADDRESS_HOME] = new HomeAddress(); |
32 } | 32 } |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 AutoFillProfile::AutoFillProfile(const std::string& guid) | 36 AutoFillProfile::AutoFillProfile(const std::string& guid) |
37 : guid_(guid) { | 37 : guid_(guid) { |
38 InitPersonalInfo(&personal_info_); | 38 InitPersonalInfo(&personal_info_); |
39 } | 39 } |
40 | 40 |
41 AutoFillProfile::AutoFillProfile() | 41 AutoFillProfile::AutoFillProfile() |
42 : guid_(guid::GenerateGUID()) { | 42 : guid_(base::GenerateGUID()) { |
43 InitPersonalInfo(&personal_info_); | 43 InitPersonalInfo(&personal_info_); |
44 } | 44 } |
45 | 45 |
46 AutoFillProfile::AutoFillProfile(const AutoFillProfile& source) | 46 AutoFillProfile::AutoFillProfile(const AutoFillProfile& source) |
47 : FormGroup() { | 47 : FormGroup() { |
48 operator=(source); | 48 operator=(source); |
49 } | 49 } |
50 | 50 |
51 AutoFillProfile::~AutoFillProfile() { | 51 AutoFillProfile::~AutoFillProfile() { |
52 STLDeleteContainerPairSecondPointers(personal_info_.begin(), | 52 STLDeleteContainerPairSecondPointers(personal_info_.begin(), |
(...skipping 434 matching lines...) Loading... |
487 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP))) | 487 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP))) |
488 << " " | 488 << " " |
489 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY))) | 489 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY))) |
490 << " " | 490 << " " |
491 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( | 491 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( |
492 PHONE_HOME_WHOLE_NUMBER))) | 492 PHONE_HOME_WHOLE_NUMBER))) |
493 << " " | 493 << " " |
494 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( | 494 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( |
495 PHONE_FAX_WHOLE_NUMBER))); | 495 PHONE_FAX_WHOLE_NUMBER))); |
496 } | 496 } |
OLD | NEW |