OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_ | |
6 #define CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/string16.h" | |
13 #include "chrome/browser/api/webdata/web_data_service_base.h" | |
14 | |
15 class AutofillProfile; | |
16 class CreditCard; | |
17 class Profile; | |
18 class WebDataServiceConsumer; | |
19 struct FormFieldData; | |
20 | |
21 // Pure virtual interface for retrieving Autofill data. API users | |
22 // should use AutofillWebDataService. | |
23 class AutofillWebData { | |
24 public: | |
25 virtual ~AutofillWebData() {} | |
26 | |
27 // Schedules a task to add form fields to the web database. | |
28 virtual void AddFormFields( | |
29 const std::vector<FormFieldData>& fields) = 0; | |
30 | |
31 // Initiates the request for a vector of values which have been entered in | |
32 // form input fields named |name|. The method OnWebDataServiceRequestDone of | |
33 // |consumer| gets called back when the request is finished, with the vector | |
34 // included in the argument |result|. | |
35 virtual WebDataServiceBase::Handle GetFormValuesForElementName( | |
36 const string16& name, | |
37 const string16& prefix, | |
38 int limit, | |
39 WebDataServiceConsumer* consumer) = 0; | |
40 | |
41 // Removes form elements recorded for Autocomplete from the database. | |
42 virtual void RemoveFormElementsAddedBetween( | |
43 const base::Time& delete_begin, const base::Time& delete_end) = 0; | |
44 | |
45 virtual void RemoveExpiredFormElements() = 0; | |
46 virtual void RemoveFormValueForElementName(const string16& name, | |
47 const string16& value) = 0; | |
48 | |
49 // Schedules a task to add an Autofill profile to the web database. | |
50 virtual void AddAutofillProfile(const AutofillProfile& profile) = 0; | |
51 | |
52 // Schedules a task to update an Autofill profile in the web database. | |
53 virtual void UpdateAutofillProfile(const AutofillProfile& profile) = 0; | |
54 | |
55 // Schedules a task to remove an Autofill profile from the web database. | |
56 // |guid| is the identifer of the profile to remove. | |
57 virtual void RemoveAutofillProfile(const std::string& guid) = 0; | |
58 | |
59 // Initiates the request for all Autofill profiles. The method | |
60 // OnWebDataServiceRequestDone of |consumer| gets called when the request is | |
61 // finished, with the profiles included in the argument |result|. The | |
62 // consumer owns the profiles. | |
63 virtual WebDataServiceBase::Handle GetAutofillProfiles( | |
64 WebDataServiceConsumer* consumer) = 0; | |
65 | |
66 // Schedules a task to add credit card to the web database. | |
67 virtual void AddCreditCard(const CreditCard& credit_card) = 0; | |
68 | |
69 // Schedules a task to update credit card in the web database. | |
70 virtual void UpdateCreditCard(const CreditCard& credit_card) = 0; | |
71 | |
72 // Schedules a task to remove a credit card from the web database. | |
73 // |guid| is identifer of the credit card to remove. | |
74 virtual void RemoveCreditCard(const std::string& guid) = 0; | |
75 | |
76 // Initiates the request for all credit cards. The method | |
77 // OnWebDataServiceRequestDone of |consumer| gets called when the request is | |
78 // finished, with the credit cards included in the argument |result|. The | |
79 // consumer owns the credit cards. | |
80 virtual WebDataServiceBase::Handle GetCreditCards( | |
81 WebDataServiceConsumer* consumer) = 0; | |
82 | |
83 // Removes Autofill records from the database. | |
84 virtual void RemoveAutofillDataModifiedBetween( | |
85 const base::Time& delete_begin, const base::Time& delete_end) = 0; | |
86 }; | |
87 | |
88 #endif // CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_ | |
OLD | NEW |