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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // full number is downloaded, it will be stored here. | 160 // full number is downloaded, it will be stored here. |
161 // | 161 // |
162 // id Server ID. This can be joined with the id in the | 162 // id Server ID. This can be joined with the id in the |
163 // masked_credit_cards table to get the rest of the data. | 163 // masked_credit_cards table to get the rest of the data. |
164 // card_number_encrypted | 164 // card_number_encrypted |
165 // Full card number, encrypted. | 165 // Full card number, encrypted. |
166 // use_count The number of times this card has been used to fill | 166 // use_count The number of times this card has been used to fill |
167 // a form. Added in version 62. | 167 // a form. Added in version 62. |
168 // use_date The date this card was last used to fill a form, in | 168 // use_date The date this card was last used to fill a form, in |
169 // internal time format (NOT time_t). Added in version 62. | 169 // internal time format (NOT time_t). Added in version 62. |
| 170 // unmask_date The date this card was unmasked in units of |
| 171 // Time::ToInternalValue. Added in version 64. |
170 // | 172 // |
171 // server_addresses This table contains Autofill address data synced from | 173 // server_addresses This table contains Autofill address data synced from |
172 // the wallet server. It's basically the same as the | 174 // the wallet server. It's basically the same as the |
173 // autofill_profiles table but locally immutable. | 175 // autofill_profiles table but locally immutable. |
174 // | 176 // |
175 // id String assigned by the server to identify this address. | 177 // id String assigned by the server to identify this address. |
176 // This is opaque to the client. | 178 // This is opaque to the client. |
177 // recipient_name Added in v63. | 179 // recipient_name Added in v63. |
178 // company_name | 180 // company_name |
179 // street_address The combined lines of the street address. | 181 // street_address The combined lines of the street address. |
180 // address_1 Also known as "administrative area". This is normally | 182 // address_1 Also known as "administrative area". This is normally |
181 // the state or province in most countries. | 183 // the state or province in most countries. |
182 // address_2 Also known as "locality". In the US this is the city. | 184 // address_2 Also known as "locality". In the US this is the city. |
183 // address_3 A sub-classification beneath the city, e.g. an | 185 // address_3 A sub-classification beneath the city, e.g. an |
184 // inner-city district or suburb. Also known as | 186 // inner-city district or suburb. Also known as |
185 // "dependent_locality". | 187 // "dependent_locality". |
186 // address_4 Used in certain countries. Also known as | 188 // address_4 Used in certain countries. Also known as |
187 // "sub_dependent_locality". | 189 // "sub_dependent_locality". |
188 // postal_code | 190 // postal_code |
189 // sorting_code Similar to the zipcode column, but used for businesses | 191 // sorting_code Similar to the zipcode column, but used for businesses |
190 // or organizations that might not be geographically | 192 // or organizations that might not be geographically |
191 // contiguous. The canonical example is CEDEX in France. | 193 // contiguous. The canonical example is CEDEX in France. |
192 // country_code | 194 // country_code |
193 // language_code The BCP 47 language code used to format the address for | 195 // language_code The BCP 47 language code used to format the address for |
194 // display. For example, a JP address with "ja" language | 196 // display. For example, a JP address with "ja" language |
195 // code starts with the postal code, but a JP address with | 197 // code starts with the postal code, but a JP address with |
196 // "ja-latn" language code starts with the recipient name. | 198 // "ja-latn" language code starts with the recipient name. |
197 // | 199 // phone_number Phone number. This is a string and has no formatting |
| 200 // constraints. Added in version 64. |
198 class AutofillTable : public WebDatabaseTable { | 201 class AutofillTable : public WebDatabaseTable { |
199 public: | 202 public: |
200 explicit AutofillTable(const std::string& app_locale); | 203 explicit AutofillTable(const std::string& app_locale); |
201 ~AutofillTable() override; | 204 ~AutofillTable() override; |
202 | 205 |
203 // Retrieves the AutofillTable* owned by |database|. | 206 // Retrieves the AutofillTable* owned by |database|. |
204 static AutofillTable* FromWebDatabase(WebDatabase* db); | 207 static AutofillTable* FromWebDatabase(WebDatabase* db); |
205 | 208 |
206 WebDatabaseTable::TypeKey GetTypeKey() const override; | 209 WebDatabaseTable::TypeKey GetTypeKey() const override; |
207 bool CreateTablesIfNecessary() override; | 210 bool CreateTablesIfNecessary() override; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 362 |
360 // Table migration functions. | 363 // Table migration functions. |
361 bool MigrateToVersion54AddI18nFieldsAndRemoveDeprecatedFields(); | 364 bool MigrateToVersion54AddI18nFieldsAndRemoveDeprecatedFields(); |
362 bool MigrateToVersion55MergeAutofillDatesTable(); | 365 bool MigrateToVersion55MergeAutofillDatesTable(); |
363 bool MigrateToVersion56AddProfileLanguageCodeForFormatting(); | 366 bool MigrateToVersion56AddProfileLanguageCodeForFormatting(); |
364 bool MigrateToVersion57AddFullNameField(); | 367 bool MigrateToVersion57AddFullNameField(); |
365 bool MigrateToVersion60AddServerCards(); | 368 bool MigrateToVersion60AddServerCards(); |
366 bool MigrateToVersion61AddUsageStats(); | 369 bool MigrateToVersion61AddUsageStats(); |
367 bool MigrateToVersion62AddUsageStatsForUnmaskedCards(); | 370 bool MigrateToVersion62AddUsageStatsForUnmaskedCards(); |
368 bool MigrateToVersion63AddServerRecipientName(); | 371 bool MigrateToVersion63AddServerRecipientName(); |
| 372 bool MigrateToVersion64AddUnmaskDate(); |
369 | 373 |
370 // Max data length saved in the table; | 374 // Max data length saved in the table; |
371 static const size_t kMaxDataLength; | 375 static const size_t kMaxDataLength; |
372 | 376 |
373 private: | 377 private: |
374 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); | 378 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); |
375 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); | 379 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); |
376 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_RemoveBetweenChanges); | 380 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_RemoveBetweenChanges); |
377 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_UpdateDontReplace); | 381 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_UpdateDontReplace); |
378 FRIEND_TEST_ALL_PREFIXES( | 382 FRIEND_TEST_ALL_PREFIXES( |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 // created (on the UI thread), and cached here so that it can be used for | 446 // created (on the UI thread), and cached here so that it can be used for |
443 // migrations (on the DB thread). | 447 // migrations (on the DB thread). |
444 std::string app_locale_; | 448 std::string app_locale_; |
445 | 449 |
446 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 450 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
447 }; | 451 }; |
448 | 452 |
449 } // namespace autofill | 453 } // namespace autofill |
450 | 454 |
451 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 455 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
OLD | NEW |