| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_UTIL_H_ | |
| 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_UTIL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "app/sql/statement.h" | |
| 10 #include "base/string16.h" | |
| 11 | |
| 12 class AutofillProfile; | |
| 13 class CreditCard; | |
| 14 | |
| 15 // Constants for the |autofill_profile_phones| |type| column. | |
| 16 enum AutofillPhoneType { | |
| 17 kAutofillPhoneNumber = 0, | |
| 18 kAutofillFaxNumber = 1 | |
| 19 }; | |
| 20 | |
| 21 namespace autofill_util { | |
| 22 | |
| 23 // TODO(jhawkins): This is a temporary stop-gap measure designed to prevent | |
| 24 // a malicious site from DOS'ing the browser with extremely large profile | |
| 25 // data. The correct solution is to parse this data asynchronously. | |
| 26 // See http://crbug.com/49332. | |
| 27 string16 LimitDataSize(const string16& data); | |
| 28 | |
| 29 void BindAutofillProfileToStatement(const AutofillProfile& profile, | |
| 30 sql::Statement* s); | |
| 31 | |
| 32 AutofillProfile* AutofillProfileFromStatement(const sql::Statement& s); | |
| 33 | |
| 34 void BindCreditCardToStatement(const CreditCard& credit_card, | |
| 35 sql::Statement* s); | |
| 36 | |
| 37 CreditCard* CreditCardFromStatement(const sql::Statement& s); | |
| 38 | |
| 39 bool AddAutofillProfileNamesToProfile(sql::Connection* db, | |
| 40 AutofillProfile* profile); | |
| 41 | |
| 42 bool AddAutofillProfileEmailsToProfile(sql::Connection* db, | |
| 43 AutofillProfile* profile); | |
| 44 | |
| 45 bool AddAutofillProfilePhonesToProfile(sql::Connection* db, | |
| 46 AutofillProfile* profile); | |
| 47 | |
| 48 bool AddAutofillProfileFaxesToProfile(sql::Connection* db, | |
| 49 AutofillProfile* profile); | |
| 50 | |
| 51 bool AddAutofillProfileNames(const AutofillProfile& profile, | |
| 52 sql::Connection* db); | |
| 53 | |
| 54 bool AddAutofillProfileEmails(const AutofillProfile& profile, | |
| 55 sql::Connection* db); | |
| 56 | |
| 57 bool AddAutofillProfilePhones(const AutofillProfile& profile, | |
| 58 AutofillPhoneType phone_type, | |
| 59 sql::Connection* db); | |
| 60 | |
| 61 bool AddAutofillProfilePieces(const AutofillProfile& profile, | |
| 62 sql::Connection* db); | |
| 63 | |
| 64 bool RemoveAutofillProfilePieces(const std::string& guid, sql::Connection* db); | |
| 65 | |
| 66 } // namespace autofill_util | |
| 67 | |
| 68 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_UTIL_H_ | |
| OLD | NEW |