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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_H_ |
6 #define CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_H_ | 6 #define CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "chrome/browser/api/webdata/autofill_web_data.h" | 10 #include "chrome/browser/api/webdata/autofill_web_data.h" |
9 | 11 |
| 12 class AutofillChange; |
| 13 class WebDatabaseService; |
| 14 |
10 namespace content { | 15 namespace content { |
11 class BrowserContext; | 16 class BrowserContext; |
12 } | 17 } |
13 | 18 |
| 19 typedef std::vector<AutofillChange> AutofillChangeList; |
| 20 |
14 // API for Autofill web data. | 21 // API for Autofill web data. |
15 class AutofillWebDataService | 22 class AutofillWebDataService |
16 : public AutofillWebData, | 23 : public AutofillWebData, |
17 public WebDataServiceBase { | 24 public WebDataServiceBase { |
18 public: | 25 public: |
19 // TODO(joi): This should take a ProfileErrorCallback once this | |
20 // class doesn't simply delegate to WebDataService. | |
21 AutofillWebDataService(); | 26 AutofillWebDataService(); |
22 | 27 |
| 28 AutofillWebDataService(scoped_refptr<WebDatabaseService> wdbs, |
| 29 const ProfileErrorCallback& callback); |
| 30 |
23 // Retrieve an AutofillWebDataService for the given context. | 31 // Retrieve an AutofillWebDataService for the given context. |
24 // | 32 // |
25 // Can return NULL in some contexts. | 33 // Can return NULL in some contexts. |
26 static scoped_refptr<AutofillWebDataService> FromBrowserContext( | 34 static scoped_refptr<AutofillWebDataService> FromBrowserContext( |
27 content::BrowserContext* context); | 35 content::BrowserContext* context); |
28 | 36 |
| 37 // Notifies listeners on the UI thread that multiple changes have been made to |
| 38 // to Autofill records of the database. |
| 39 // NOTE: This method is intended to be called from the DB thread. It |
| 40 // it asynchronously notifies listeners on the UI thread. |
| 41 // |web_data_service| may be NULL for testing purposes. |
| 42 static void NotifyOfMultipleAutofillChanges( |
| 43 AutofillWebDataService* web_data_service); |
| 44 |
29 protected: | 45 protected: |
30 virtual ~AutofillWebDataService() {} | 46 virtual ~AutofillWebDataService() {} |
31 }; | 47 }; |
32 | 48 |
33 #endif // CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_H_ | 49 #endif // CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_H_ |
OLD | NEW |