OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_type.h" | 5 #include "chrome/browser/autofill/autofill_type.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 // TODO(jhawkins) all of the Human Readable names will need to be added to a | 10 // TODO(jhawkins) all of the Human Readable names will need to be added to a |
(...skipping 21 matching lines...) Expand all Loading... |
32 { PHONE_HOME_WHOLE_NUMBER, AutoFillType::PHONE_HOME, AutoFillType::PHONE_WHOLE
_NUMBER, "Home Phone Number" }, | 32 { PHONE_HOME_WHOLE_NUMBER, AutoFillType::PHONE_HOME, AutoFillType::PHONE_WHOLE
_NUMBER, "Home Phone Number" }, |
33 | 33 |
34 { PHONE_FAX_NUMBER, AutoFillType::PHONE_FAX, AutoFillType::PHONE_NUMBER, "Fax
Number" }, | 34 { PHONE_FAX_NUMBER, AutoFillType::PHONE_FAX, AutoFillType::PHONE_NUMBER, "Fax
Number" }, |
35 { PHONE_FAX_CITY_CODE, AutoFillType::PHONE_FAX, AutoFillType::PHONE_CITY_CODE,
"Fax Area Code" }, | 35 { PHONE_FAX_CITY_CODE, AutoFillType::PHONE_FAX, AutoFillType::PHONE_CITY_CODE,
"Fax Area Code" }, |
36 { PHONE_FAX_COUNTRY_CODE, AutoFillType::PHONE_FAX, AutoFillType::PHONE_COUNTRY
_CODE, "Fax Country Code" }, | 36 { PHONE_FAX_COUNTRY_CODE, AutoFillType::PHONE_FAX, AutoFillType::PHONE_COUNTRY
_CODE, "Fax Country Code" }, |
37 { PHONE_FAX_CITY_AND_NUMBER, AutoFillType::PHONE_FAX, AutoFillType::PHONE_CITY
_AND_NUMBER, "Fax Number" }, | 37 { PHONE_FAX_CITY_AND_NUMBER, AutoFillType::PHONE_FAX, AutoFillType::PHONE_CITY
_AND_NUMBER, "Fax Number" }, |
38 { PHONE_FAX_WHOLE_NUMBER, AutoFillType::PHONE_FAX, AutoFillType::PHONE_WHOLE_N
UMBER, "Fax Number" }, | 38 { PHONE_FAX_WHOLE_NUMBER, AutoFillType::PHONE_FAX, AutoFillType::PHONE_WHOLE_N
UMBER, "Fax Number" }, |
39 | 39 |
40 { ADDRESS_HOME_LINE1, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_LINE1,
"Home Address Line 1" }, | 40 { ADDRESS_HOME_LINE1, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_LINE1,
"Home Address Line 1" }, |
41 { ADDRESS_HOME_LINE2, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_LINE2,
"Home Address Line 2" }, | 41 { ADDRESS_HOME_LINE2, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_LINE2,
"Home Address Line 2" }, |
42 { ADDRESS_HOME_APPT_NUM, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_APP
T_NUM, "Home Address Apartment Number" }, | 42 { ADDRESS_HOME_APT_NUM, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_APT_
NUM, "Home Address Apartment Number" }, |
43 { ADDRESS_HOME_CITY, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_CITY,
"Home Address City" }, | 43 { ADDRESS_HOME_CITY, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_CITY,
"Home Address City" }, |
44 { ADDRESS_HOME_STATE, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_STATE,
"Home Address State" }, | 44 { ADDRESS_HOME_STATE, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_STATE,
"Home Address State" }, |
45 { ADDRESS_HOME_ZIP, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_ZIP, "Ho
me Address Zip Code" }, | 45 { ADDRESS_HOME_ZIP, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_ZIP, "Ho
me Address Zip Code" }, |
46 { ADDRESS_HOME_COUNTRY, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_COUN
TRY, "Home Address Country" }, | 46 { ADDRESS_HOME_COUNTRY, AutoFillType::ADDRESS_HOME, AutoFillType::ADDRESS_COUN
TRY, "Home Address Country" }, |
47 | 47 |
48 { ADDRESS_BILLING_LINE1, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_
LINE1, "Billing Address Line 1" }, | 48 { ADDRESS_BILLING_LINE1, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_
LINE1, "Billing Address Line 1" }, |
49 { ADDRESS_BILLING_LINE2, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_
LINE2, "Billing Address Line 2" }, | 49 { ADDRESS_BILLING_LINE2, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_
LINE2, "Billing Address Line 2" }, |
50 { ADDRESS_BILLING_APPT_NUM, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRE
SS_APPT_NUM, "Billing Address Apartment Number" }, | 50 { ADDRESS_BILLING_APT_NUM, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRES
S_APT_NUM, "Billing Address Apartment Number" }, |
51 { ADDRESS_BILLING_CITY, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_C
ITY, "Billing Address City" }, | 51 { ADDRESS_BILLING_CITY, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_C
ITY, "Billing Address City" }, |
52 { ADDRESS_BILLING_STATE, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_
STATE, "Billing Address State" }, | 52 { ADDRESS_BILLING_STATE, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_
STATE, "Billing Address State" }, |
53 { ADDRESS_BILLING_ZIP, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_ZI
P, "Billing Address Zip Code" }, | 53 { ADDRESS_BILLING_ZIP, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRESS_ZI
P, "Billing Address Zip Code" }, |
54 { ADDRESS_BILLING_COUNTRY, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRES
S_COUNTRY, "Billing Address Country" }, | 54 { ADDRESS_BILLING_COUNTRY, AutoFillType::ADDRESS_BILLING, AutoFillType::ADDRES
S_COUNTRY, "Billing Address Country" }, |
55 | 55 |
56 { CREDIT_CARD_NAME, AutoFillType::CREDIT_CARD, AutoFillType::NO_SUBGROUP, "Nam
e on Credit Card" }, | 56 { CREDIT_CARD_NAME, AutoFillType::CREDIT_CARD, AutoFillType::NO_SUBGROUP, "Nam
e on Credit Card" }, |
57 { CREDIT_CARD_NUMBER, AutoFillType::CREDIT_CARD, AutoFillType::NO_SUBGROUP, "C
redit Card Number" }, | 57 { CREDIT_CARD_NUMBER, AutoFillType::CREDIT_CARD, AutoFillType::NO_SUBGROUP, "C
redit Card Number" }, |
58 { CREDIT_CARD_EXP_MONTH, AutoFillType::CREDIT_CARD, AutoFillType::NO_SUBGROUP,
"Credit Card Expiration Month" }, | 58 { CREDIT_CARD_EXP_MONTH, AutoFillType::CREDIT_CARD, AutoFillType::NO_SUBGROUP,
"Credit Card Expiration Month" }, |
59 { CREDIT_CARD_EXP_2_DIGIT_YEAR, AutoFillType::CREDIT_CARD, AutoFillType::NO_SU
BGROUP, "Credit Card Expiration Year" }, | 59 { CREDIT_CARD_EXP_2_DIGIT_YEAR, AutoFillType::CREDIT_CARD, AutoFillType::NO_SU
BGROUP, "Credit Card Expiration Year" }, |
60 { CREDIT_CARD_EXP_4_DIGIT_YEAR, AutoFillType::CREDIT_CARD, AutoFillType::NO_SU
BGROUP, "Credit Card Expiration Year" }, | 60 { CREDIT_CARD_EXP_4_DIGIT_YEAR, AutoFillType::CREDIT_CARD, AutoFillType::NO_SU
BGROUP, "Credit Card Expiration Year" }, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 InitializeFieldTypeMap(); | 97 InitializeFieldTypeMap(); |
98 } | 98 } |
99 | 99 |
100 void AutoFillType::InitializeFieldTypeMap() { | 100 void AutoFillType::InitializeFieldTypeMap() { |
101 for (size_t i = 0; i < arraysize(kAutoFillTypeDefinitions); ++i) { | 101 for (size_t i = 0; i < arraysize(kAutoFillTypeDefinitions); ++i) { |
102 AutoFillType type(&kAutoFillTypeDefinitions[i]); | 102 AutoFillType type(&kAutoFillTypeDefinitions[i]); |
103 types_[type.field_type()] = type; | 103 types_[type.field_type()] = type; |
104 } | 104 } |
105 } | 105 } |
OLD | NEW |