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
3 // found in the LICENSE file.
5 // Sync protocol datatype extension for autofill.
7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
8 // any fields in this file.
12 option optimize_for = LITE_RUNTIME;
13 option retain_unknown_fields = true;
17 // Properties of autofill sync objects.
19 // An AutofillProfile.
20 message AutofillProfileSpecifics {
21 optional string guid = 15;
22 optional string origin = 16;
23 optional int64 use_count = 22;
25 // The time_t value of the last time this profile was used. This
26 // value makes sense wrt base::Time::To/FromTimeT, which measures
27 // from the Windows epoch.
28 optional int64 use_date = 23;
31 repeated string name_first = 2;
32 repeated string name_middle = 3;
33 repeated string name_last = 4;
34 repeated string name_full = 21;
35 repeated string email_address = 5;
36 optional string company_name = 6;
39 optional string address_home_line1 = 7;
40 optional string address_home_line2 = 8;
41 optional string address_home_city = 9;
42 optional string address_home_state = 10;
43 optional string address_home_zip = 11;
44 optional string address_home_country = 12;
46 // Additional address fields for i18n.
47 optional string address_home_street_address = 17;
48 optional string address_home_sorting_code = 18;
49 optional string address_home_dependent_locality = 19;
50 optional string address_home_language_code = 20;
53 repeated string phone_home_whole_number = 13;
56 optional string label = 1 [deprecated=true];
57 optional string phone_fax_whole_number = 14 [deprecated=true];
60 message AutofillSpecifics {
61 // If any of these 3 fields are present, then all 3 should be, and it implies
62 // that this entity represents a classic autofill object. In this case,
63 // none of the autofill++ objects below should be present.
64 optional string name = 1;
65 optional string value = 2;
66 repeated int64 usage_timestamp = 3;
68 // An autofill++ profile object. If present, indicates this entity
69 // represents an AutofillProfile exclusively, and no other fields (such as
70 // name/value or credit_card) should be present.
71 optional AutofillProfileSpecifics profile = 4;
73 // Obsolete credit card fields.
74 // optional bytes deprecated_encrypted_credit_card = 5;
75 // optional AutofillCreditCardSpecifics deprecated_credit_card = 6;
78 message WalletMaskedCreditCard {
79 enum WalletCardStatus {
96 // Server-generated unique ID string. This is opaque to the client.
97 optional string id = 1;
99 // What the server thinks of this card.
100 optional WalletCardStatus status = 2;
102 optional string name_on_card = 3;
104 optional WalletCardType type = 4;
106 // Last 4 digits of the credit card number.
107 optional string last_four = 5;
109 // Month number 1-12.
110 optional int32 exp_month = 6;
112 // Four-digit year (e.g. 2017).
113 optional int32 exp_year = 7;
116 // Different than an AutofillProfile because this represents some known address
117 // on the server that is pulled down rather than synced between Chromes.
118 message WalletPostalAddress {
120 optional string id = 1;
122 optional string recipient_name = 12;
123 optional string company_name = 2;
125 // This is the street address, of which there may be multiple lines. This
126 // corresponds to "address_home_line[1|2] in the AutofillProfileSpecifics
127 // message above. In some locales there may be more than two lines.
128 repeated string street_address = 3;
130 // Also known as "administrative area". This is normally the state or
131 // province in most countries.
132 optional string address_1 = 4;
134 // Also known as "locality". In the US this is the city.
135 optional string address_2 = 5;
137 // A sub-classification beneath the city, e.g. an inner-city district or
138 // suburb. Also known as "dependent_locality"
139 optional string address_3 = 6;
141 // Used in certain countries. Also known as "sub_dependent_locality".
142 optional string address_4 = 7;
144 optional string postal_code = 8;
146 // Similar to the zipcode column, but used for businesses or organizations
147 // that might not be geographically contiguous. The canonical example is
149 optional string sorting_code = 9;
151 optional string country_code = 10;
152 optional string language_code = 11;
154 // Phone number. The format is unspecified and will be explicitly ignored.
155 optional string phone_number = 13;
158 message AutofillWalletSpecifics {
159 enum WalletInfoType {
161 MASKED_CREDIT_CARD = 1;
165 optional WalletInfoType type = 1;
167 // This field exists if and only if the "type" field equals to
168 // MASKED_CREDIT_CARD.
169 optional WalletMaskedCreditCard masked_card = 2;
171 // This field exists if and only if the "type" field equals to ADDRESS.
172 optional WalletPostalAddress address = 3;
175 // Wallet card and address usage information that can be synced.
176 message WalletMetadataSpecifics {
183 // The type of the Wallet metadata.
184 optional Type type = 1;
186 // Unique ID string of the corresponding Wallet data.
187 // For Wallet cards, this value is server generated and opaque to Chrome.
188 // For Wallet addresses, this is a SHA1 hash of the following fields:
195 // - Dependent locality
203 // Finally, Chrome appends the address language code to the end of the hash.
204 optional string id = 2;
206 // The number of times that this Wallet card or address was used.
207 optional int64 use_count = 3;
209 // The last use date of this Wallet card or address. Measured in microseconds
210 // since the Windows epoch (1601).
211 optional int64 use_date = 4;