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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 // city | 62 // city |
63 // state | 63 // state |
64 // zipcode | 64 // zipcode |
65 // sorting_code Similar to the zipcode column, but used for businesses | 65 // sorting_code Similar to the zipcode column, but used for businesses |
66 // or organizations that might not be geographically | 66 // or organizations that might not be geographically |
67 // contiguous. The canonical example is CEDEX in France. | 67 // contiguous. The canonical example is CEDEX in France. |
68 // Added in version 54. | 68 // Added in version 54. |
69 // country_code | 69 // country_code |
70 // use_count The number of times this profile has been used to fill | 70 // use_count The number of times this profile has been used to fill |
71 // a form. | 71 // a form. |
72 // last_use The date this profile was last used to fill a form. | 72 // use_date The date this profile was last used to fill a form. |
73 // date_modified The date on which this profile was last modified. | 73 // date_modified The date on which this profile was last modified. |
74 // Added in version 30. | 74 // Added in version 30. |
75 // origin The domain of origin for this profile. | 75 // origin The domain of origin for this profile. |
76 // Added in version 50. | 76 // Added in version 50. |
77 // language_code The BCP 47 language code used to format the address for | 77 // language_code The BCP 47 language code used to format the address for |
78 // display. For example, a JP address with "ja" language | 78 // display. For example, a JP address with "ja" language |
79 // code starts with the postal code, but a JP address with | 79 // code starts with the postal code, but a JP address with |
80 // "ja-latn" language code starts with the recipient name. | 80 // "ja-latn" language code starts with the recipient name. |
81 // Added in version 56. | 81 // Added in version 56. |
82 // | 82 // |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 // | 120 // |
121 // guid A guid string to uniquely identify the profile. | 121 // guid A guid string to uniquely identify the profile. |
122 // Added in version 31. | 122 // Added in version 31. |
123 // name_on_card | 123 // name_on_card |
124 // expiration_month | 124 // expiration_month |
125 // expiration_year | 125 // expiration_year |
126 // card_number_encrypted | 126 // card_number_encrypted |
127 // Stores encrypted credit card number. | 127 // Stores encrypted credit card number. |
128 // use_count The number of times this card has been used to fill | 128 // use_count The number of times this card has been used to fill |
129 // a form. | 129 // a form. |
130 // last_use The date this card was last used to fill a form. | 130 // use_date The date this card was last used to fill a form. |
131 // date_modified The date on which this entry was last modified. | 131 // date_modified The date on which this entry was last modified. |
132 // Added in version 30. | 132 // Added in version 30. |
133 // origin The domain of origin for this profile. | 133 // origin The domain of origin for this profile. |
134 // Added in version 50. | 134 // Added in version 50. |
135 // | 135 // |
136 // masked_credit_cards | 136 // masked_credit_cards |
137 // This table contains "masked" credit card information | 137 // This table contains "masked" credit card information |
138 // about credit cards stored on the server. It consists | 138 // about credit cards stored on the server. It consists |
139 // of a short description and an ID, but not full payment | 139 // of a short description and an ID, but not full payment |
140 // information. Writing to this table is only done by sync. | 140 // information. Writing to this table is only done by sync. |
(...skipping 13 matching lines...) Expand all Loading... | |
154 // exp_year Four-digit year: 2017 | 154 // exp_year Four-digit year: 2017 |
155 // | 155 // |
156 // unmasked_credit_cards | 156 // unmasked_credit_cards |
157 // When a masked credit credit card is unmasked and the | 157 // When a masked credit credit card is unmasked and the |
158 // full number is downloaded, it will be stored here. | 158 // full number is downloaded, it will be stored here. |
159 // | 159 // |
160 // id Server ID. This can be joined with the id in the | 160 // id Server ID. This can be joined with the id in the |
161 // masked_credit_cards table to get the rest of the data. | 161 // masked_credit_cards table to get the rest of the data. |
162 // card_number_encrypted | 162 // card_number_encrypted |
163 // Full card number, encrypted. | 163 // Full card number, encrypted. |
164 // use_count The number of times this card has been used to fill | |
165 // a form. | |
166 // use_date The date this card was last used to fill a form. | |
brettw
2015/02/23 19:04:34
Can we call this (and the other one above) "last_u
Evan Stade
2015/02/23 22:57:22
I'd like to be consistent with the names used in t
| |
164 // | 167 // |
165 // server_addresses This table contains Autofill address data synced from | 168 // server_addresses This table contains Autofill address data synced from |
166 // the wallet server. It's basically the same as the | 169 // the wallet server. It's basically the same as the |
167 // autofill_profiles table but locally immutable. | 170 // autofill_profiles table but locally immutable. |
168 // | 171 // |
169 // id String assigned by the server to identify this address. | 172 // id String assigned by the server to identify this address. |
170 // This is opaque to the client. | 173 // This is opaque to the client. |
171 // company_name | 174 // company_name |
172 // street_address The combined lines of the street address. | 175 // street_address The combined lines of the street address. |
173 // address_1 Also known as "administrative area". This is normally | 176 // address_1 Also known as "administrative area". This is normally |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 // present in the new list will be preserved (even if the input is MASKED). | 307 // present in the new list will be preserved (even if the input is MASKED). |
305 void SetServerCreditCards(const std::vector<CreditCard>& credit_cards); | 308 void SetServerCreditCards(const std::vector<CreditCard>& credit_cards); |
306 | 309 |
307 // Cards synced from the server may be "masked" (only last 4 digits | 310 // Cards synced from the server may be "masked" (only last 4 digits |
308 // available) or "unmasked" (everything is available). These functions set | 311 // available) or "unmasked" (everything is available). These functions set |
309 // that state. | 312 // that state. |
310 bool UnmaskServerCreditCard(const std::string& id, | 313 bool UnmaskServerCreditCard(const std::string& id, |
311 const base::string16& full_number); | 314 const base::string16& full_number); |
312 bool MaskServerCreditCard(const std::string& id); | 315 bool MaskServerCreditCard(const std::string& id); |
313 | 316 |
317 // Updates the use count and last use date for an unmasked server card. | |
318 bool UpdateUnmaskedCardUsageStats(const CreditCard& credit_card); | |
319 | |
314 // Removes rows from autofill_profiles and credit_cards if they were created | 320 // Removes rows from autofill_profiles and credit_cards if they were created |
315 // on or after |delete_begin| and strictly before |delete_end|. Returns the | 321 // on or after |delete_begin| and strictly before |delete_end|. Returns the |
316 // list of deleted profile guids in |profile_guids|. Return value is true if | 322 // list of deleted profile guids in |profile_guids|. Return value is true if |
317 // all rows were successfully removed. Returns false on database error. In | 323 // all rows were successfully removed. Returns false on database error. In |
318 // that case, the output vector state is undefined, and may be partially | 324 // that case, the output vector state is undefined, and may be partially |
319 // filled. | 325 // filled. |
320 bool RemoveAutofillDataModifiedBetween( | 326 bool RemoveAutofillDataModifiedBetween( |
321 const base::Time& delete_begin, | 327 const base::Time& delete_begin, |
322 const base::Time& delete_end, | 328 const base::Time& delete_end, |
323 std::vector<std::string>* profile_guids, | 329 std::vector<std::string>* profile_guids, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
362 bool MigrateToVersion34ProfilesBasedOnCountryCode(); | 368 bool MigrateToVersion34ProfilesBasedOnCountryCode(); |
363 bool MigrateToVersion35GreatBritainCountryCodes(); | 369 bool MigrateToVersion35GreatBritainCountryCodes(); |
364 bool MigrateToVersion37MergeAndCullOlderProfiles(); | 370 bool MigrateToVersion37MergeAndCullOlderProfiles(); |
365 bool MigrateToVersion51AddOriginColumn(); | 371 bool MigrateToVersion51AddOriginColumn(); |
366 bool MigrateToVersion54AddI18nFieldsAndRemoveDeprecatedFields(); | 372 bool MigrateToVersion54AddI18nFieldsAndRemoveDeprecatedFields(); |
367 bool MigrateToVersion55MergeAutofillDatesTable(); | 373 bool MigrateToVersion55MergeAutofillDatesTable(); |
368 bool MigrateToVersion56AddProfileLanguageCodeForFormatting(); | 374 bool MigrateToVersion56AddProfileLanguageCodeForFormatting(); |
369 bool MigrateToVersion57AddFullNameField(); | 375 bool MigrateToVersion57AddFullNameField(); |
370 bool MigrateToVersion60AddServerCards(); | 376 bool MigrateToVersion60AddServerCards(); |
371 bool MigrateToVersion61AddUsageStats(); | 377 bool MigrateToVersion61AddUsageStats(); |
378 bool MigrateToVersion62AddUsageStatsForUnmaskedCards(); | |
372 | 379 |
373 // Max data length saved in the table; | 380 // Max data length saved in the table; |
374 static const size_t kMaxDataLength; | 381 static const size_t kMaxDataLength; |
375 | 382 |
376 private: | 383 private: |
377 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); | 384 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); |
378 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); | 385 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); |
379 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_RemoveBetweenChanges); | 386 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_RemoveBetweenChanges); |
380 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_UpdateDontReplace); | 387 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_UpdateDontReplace); |
381 FRIEND_TEST_ALL_PREFIXES( | 388 FRIEND_TEST_ALL_PREFIXES( |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 // created (on the UI thread), and cached here so that it can be used for | 452 // created (on the UI thread), and cached here so that it can be used for |
446 // migrations (on the DB thread). | 453 // migrations (on the DB thread). |
447 std::string app_locale_; | 454 std::string app_locale_; |
448 | 455 |
449 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 456 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
450 }; | 457 }; |
451 | 458 |
452 } // namespace autofill | 459 } // namespace autofill |
453 | 460 |
454 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 461 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
OLD | NEW |