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_API_WEBDATA_AUTOFILL_WEB_DATA_H_ | 5 #ifndef CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_ |
6 #define CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_ | 6 #define CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "chrome/browser/api/webdata/web_data_service_base.h" | 13 #include "chrome/browser/api/webdata/web_data_service_base.h" |
14 | 14 |
15 namespace webkit { | |
16 namespace forms { | |
17 struct FormField; | |
18 } | |
19 } | |
20 | |
21 class AutofillProfile; | 15 class AutofillProfile; |
22 class CreditCard; | 16 class CreditCard; |
23 class Profile; | 17 class Profile; |
24 class WebDataServiceConsumer; | 18 class WebDataServiceConsumer; |
| 19 struct FormFieldData; |
25 | 20 |
26 // Pure virtual interface for retrieving Autofill data. API users | 21 // Pure virtual interface for retrieving Autofill data. API users |
27 // should use AutofillWebDataService. | 22 // should use AutofillWebDataService. |
28 class AutofillWebData { | 23 class AutofillWebData { |
29 public: | 24 public: |
30 virtual ~AutofillWebData() {} | 25 virtual ~AutofillWebData() {} |
31 | 26 |
32 // Schedules a task to add form fields to the web database. | 27 // Schedules a task to add form fields to the web database. |
33 virtual void AddFormFields( | 28 virtual void AddFormFields( |
34 const std::vector<webkit::forms::FormField>& fields) = 0; | 29 const std::vector<FormFieldData>& fields) = 0; |
35 | 30 |
36 // Initiates the request for a vector of values which have been entered in | 31 // Initiates the request for a vector of values which have been entered in |
37 // form input fields named |name|. The method OnWebDataServiceRequestDone of | 32 // form input fields named |name|. The method OnWebDataServiceRequestDone of |
38 // |consumer| gets called back when the request is finished, with the vector | 33 // |consumer| gets called back when the request is finished, with the vector |
39 // included in the argument |result|. | 34 // included in the argument |result|. |
40 virtual WebDataServiceBase::Handle GetFormValuesForElementName( | 35 virtual WebDataServiceBase::Handle GetFormValuesForElementName( |
41 const string16& name, | 36 const string16& name, |
42 const string16& prefix, | 37 const string16& prefix, |
43 int limit, | 38 int limit, |
44 WebDataServiceConsumer* consumer) = 0; | 39 WebDataServiceConsumer* consumer) = 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 75 |
81 // Initiates the request for all credit cards. The method | 76 // Initiates the request for all credit cards. The method |
82 // OnWebDataServiceRequestDone of |consumer| gets called when the request is | 77 // OnWebDataServiceRequestDone of |consumer| gets called when the request is |
83 // finished, with the credit cards included in the argument |result|. The | 78 // finished, with the credit cards included in the argument |result|. The |
84 // consumer owns the credit cards. | 79 // consumer owns the credit cards. |
85 virtual WebDataServiceBase::Handle | 80 virtual WebDataServiceBase::Handle |
86 GetCreditCards(WebDataServiceConsumer* consumer) = 0; | 81 GetCreditCards(WebDataServiceConsumer* consumer) = 0; |
87 }; | 82 }; |
88 | 83 |
89 #endif // CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_ | 84 #endif // CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_ |
OLD | NEW |