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