| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 5 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "chrome/browser/webdata/web_database_table.h" | 11 #include "chrome/browser/webdata/web_database_table.h" |
| 12 | 12 |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 class AutofillChange; | 15 class AutofillChange; |
| 16 class AutofillEntry; | 16 class AutofillEntry; |
| 17 class AutofillProfile; | 17 class AutofillProfile; |
| 18 class AutofillTableTest; | 18 class AutofillTableTest; |
| 19 class CreditCard; | 19 class CreditCard; |
| 20 class WebDatabase; |
| 20 | 21 |
| 21 struct FormFieldData; | 22 struct FormFieldData; |
| 22 | 23 |
| 23 namespace base { | 24 namespace base { |
| 24 class Time; | 25 class Time; |
| 25 } | 26 } |
| 26 | 27 |
| 27 // This class manages the various Autofill tables within the SQLite database | 28 // This class manages the various Autofill tables within the SQLite database |
| 28 // passed to the constructor. It expects the following schemas: | 29 // passed to the constructor. It expects the following schemas: |
| 29 // | 30 // |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // Added in version 31. | 108 // Added in version 31. |
| 108 // name_on_card | 109 // name_on_card |
| 109 // expiration_month | 110 // expiration_month |
| 110 // expiration_year | 111 // expiration_year |
| 111 // card_number_encrypted Stores encrypted credit card number. | 112 // card_number_encrypted Stores encrypted credit card number. |
| 112 // date_modified The date on which this entry was last modified. | 113 // date_modified The date on which this entry was last modified. |
| 113 // Added in version 30. | 114 // Added in version 30. |
| 114 // | 115 // |
| 115 class AutofillTable : public WebDatabaseTable { | 116 class AutofillTable : public WebDatabaseTable { |
| 116 public: | 117 public: |
| 117 AutofillTable(sql::Connection* db, sql::MetaTable* meta_table); | 118 AutofillTable(); |
| 118 virtual ~AutofillTable(); | 119 virtual ~AutofillTable(); |
| 119 virtual bool Init() OVERRIDE; | 120 |
| 121 // Retrieves the AutofillTable* owned by |database|. |
| 122 static AutofillTable* FromWebDatabase(WebDatabase* db); |
| 123 |
| 124 virtual WebDatabaseTable::TypeKey GetTypeKey() const OVERRIDE; |
| 125 virtual bool Init(sql::Connection* db, sql::MetaTable* meta_table) OVERRIDE; |
| 120 virtual bool IsSyncable() OVERRIDE; | 126 virtual bool IsSyncable() OVERRIDE; |
| 121 virtual bool MigrateToVersion(int version, | 127 virtual bool MigrateToVersion(int version, |
| 122 const std::string& app_locale, | 128 const std::string& app_locale, |
| 123 bool* update_compatible_version) OVERRIDE; | 129 bool* update_compatible_version) OVERRIDE; |
| 124 | 130 |
| 125 // Records the form elements in |elements| in the database in the | 131 // Records the form elements in |elements| in the database in the |
| 126 // autofill table. A list of all added and updated autofill entries | 132 // autofill table. A list of all added and updated autofill entries |
| 127 // is returned in the changes out parameter. | 133 // is returned in the changes out parameter. |
| 128 bool AddFormFieldValues(const std::vector<FormFieldData>& elements, | 134 bool AddFormFieldValues(const std::vector<FormFieldData>& elements, |
| 129 std::vector<AutofillChange>* changes); | 135 std::vector<AutofillChange>* changes); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 bool InitProfilesTable(); | 353 bool InitProfilesTable(); |
| 348 bool InitProfileNamesTable(); | 354 bool InitProfileNamesTable(); |
| 349 bool InitProfileEmailsTable(); | 355 bool InitProfileEmailsTable(); |
| 350 bool InitProfilePhonesTable(); | 356 bool InitProfilePhonesTable(); |
| 351 bool InitProfileTrashTable(); | 357 bool InitProfileTrashTable(); |
| 352 | 358 |
| 353 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 359 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
| 354 }; | 360 }; |
| 355 | 361 |
| 356 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 362 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| OLD | NEW |