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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "components/autofill/core/browser/webdata/autofill_table_encryptor.h" | |
please use gerrit instead
2017/02/22 19:05:42
Can you forward-declare AutofillTableEncryptor ins
devarajn
2017/02/22 19:24:26
Done.
| |
17 #include "components/sync/base/model_type.h" | 18 #include "components/sync/base/model_type.h" |
18 #include "components/sync/model/metadata_batch.h" | 19 #include "components/sync/model/metadata_batch.h" |
19 #include "components/webdata/common/web_database_table.h" | 20 #include "components/webdata/common/web_database_table.h" |
20 | 21 |
21 class WebDatabase; | 22 class WebDatabase; |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 class Time; | 25 class Time; |
25 } | 26 } |
26 | 27 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 // | 245 // |
245 // autofill_model_type_state | 246 // autofill_model_type_state |
246 // Single row table that contains the sync ModelTypeState | 247 // Single row table that contains the sync ModelTypeState |
247 // for the autofill model type. | 248 // for the autofill model type. |
248 // | 249 // |
249 // value The serialized ModelTypeState record. | 250 // value The serialized ModelTypeState record. |
250 | 251 |
251 class AutofillTable : public WebDatabaseTable { | 252 class AutofillTable : public WebDatabaseTable { |
252 public: | 253 public: |
253 AutofillTable(); | 254 AutofillTable(); |
255 AutofillTable( | |
please use gerrit instead
2017/02/22 19:05:42
Please mark this constructor explicit to avoid acc
devarajn
2017/02/22 19:24:26
Done.
| |
256 std::unique_ptr<AutofillTableEncryptor> autofill_table_encryptor); | |
254 ~AutofillTable() override; | 257 ~AutofillTable() override; |
255 | 258 |
256 // Retrieves the AutofillTable* owned by |db|. | 259 // Retrieves the AutofillTable* owned by |db|. |
257 static AutofillTable* FromWebDatabase(WebDatabase* db); | 260 static AutofillTable* FromWebDatabase(WebDatabase* db); |
258 | 261 |
259 // WebDatabaseTable: | 262 // WebDatabaseTable: |
260 WebDatabaseTable::TypeKey GetTypeKey() const override; | 263 WebDatabaseTable::TypeKey GetTypeKey() const override; |
261 bool CreateTablesIfNecessary() override; | 264 bool CreateTablesIfNecessary() override; |
262 bool IsSyncable() override; | 265 bool IsSyncable() override; |
263 bool MigrateToVersion(int version, bool* update_compatible_version) override; | 266 bool MigrateToVersion(int version, bool* update_compatible_version) override; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 bool MigrateToVersion67AddMaskedCardBillingAddress(); | 463 bool MigrateToVersion67AddMaskedCardBillingAddress(); |
461 bool MigrateToVersion70AddSyncMetadata(); | 464 bool MigrateToVersion70AddSyncMetadata(); |
462 bool MigrateToVersion71AddHasConvertedAndBillingAddressIdMetadata(); | 465 bool MigrateToVersion71AddHasConvertedAndBillingAddressIdMetadata(); |
463 | 466 |
464 // Max data length saved in the table, AKA the maximum length allowed for | 467 // Max data length saved in the table, AKA the maximum length allowed for |
465 // form data. | 468 // form data. |
466 // Copied to components/autofill/ios/browser/resources/autofill_controller.js. | 469 // Copied to components/autofill/ios/browser/resources/autofill_controller.js. |
467 static const size_t kMaxDataLength; | 470 static const size_t kMaxDataLength; |
468 | 471 |
469 private: | 472 private: |
473 std::unique_ptr<AutofillTableEncryptor> autofill_table_encryptor_; | |
474 | |
470 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); | 475 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); |
471 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); | 476 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); |
472 FRIEND_TEST_ALL_PREFIXES( | 477 FRIEND_TEST_ALL_PREFIXES( |
473 AutofillTableTest, | 478 AutofillTableTest, |
474 Autofill_GetCountOfValuesContainedBetween); | 479 Autofill_GetCountOfValuesContainedBetween); |
475 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_RemoveBetweenChanges); | 480 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_RemoveBetweenChanges); |
476 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_UpdateDontReplace); | 481 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_UpdateDontReplace); |
477 FRIEND_TEST_ALL_PREFIXES( | 482 FRIEND_TEST_ALL_PREFIXES( |
478 AutofillTableTest, | 483 AutofillTableTest, |
479 Autofill_RemoveFormElementsAddedBetween_UsedOnlyBefore); | 484 Autofill_RemoveFormElementsAddedBetween_UsedOnlyBefore); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
545 bool InitServerAddressMetadataTable(); | 550 bool InitServerAddressMetadataTable(); |
546 bool InitAutofillSyncMetadataTable(); | 551 bool InitAutofillSyncMetadataTable(); |
547 bool InitModelTypeStateTable(); | 552 bool InitModelTypeStateTable(); |
548 | 553 |
549 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 554 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
550 }; | 555 }; |
551 | 556 |
552 } // namespace autofill | 557 } // namespace autofill |
553 | 558 |
554 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 559 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
OLD | NEW |