OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ANDROID_WEBVIEW_BROWSER_AW_FORM_DATABASE_SERVICE_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_FORM_DATABASE_SERVICE_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_AW_FORM_DATABASE_SERVICE_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_FORM_DATABASE_SERVICE_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 10 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // IO access and block. | 33 // IO access and block. |
34 bool HasFormData(); | 34 bool HasFormData(); |
35 | 35 |
36 // Clear any saved form data. Executes asynchronously. | 36 // Clear any saved form data. Executes asynchronously. |
37 void ClearFormData(); | 37 void ClearFormData(); |
38 | 38 |
39 scoped_refptr<autofill::AutofillWebDataService> | 39 scoped_refptr<autofill::AutofillWebDataService> |
40 get_autofill_webdata_service(); | 40 get_autofill_webdata_service(); |
41 | 41 |
42 // WebDataServiceConsumer implementation. | 42 // WebDataServiceConsumer implementation. |
43 void OnWebDataServiceRequestDone(WebDataServiceBase::Handle h, | 43 void OnWebDataServiceRequestDone( |
44 const WDTypedResult* result) override; | 44 WebDataServiceBase::Handle h, |
| 45 std::unique_ptr<WDTypedResult> result) override; |
45 | 46 |
46 private: | 47 private: |
47 struct PendingQuery { | 48 struct PendingQuery { |
48 bool* result; | 49 bool* result; |
49 base::WaitableEvent* completion; | 50 base::WaitableEvent* completion; |
50 }; | 51 }; |
51 typedef std::map<WebDataServiceBase::Handle, PendingQuery> QueryMap; | 52 typedef std::map<WebDataServiceBase::Handle, PendingQuery> QueryMap; |
52 | 53 |
53 void ClearFormDataImpl(); | 54 void ClearFormDataImpl(); |
54 void HasFormDataImpl(base::WaitableEvent* completion, bool* result); | 55 void HasFormDataImpl(base::WaitableEvent* completion, bool* result); |
55 | 56 |
56 QueryMap result_map_; | 57 QueryMap result_map_; |
57 | 58 |
58 scoped_refptr<autofill::AutofillWebDataService> autofill_data_; | 59 scoped_refptr<autofill::AutofillWebDataService> autofill_data_; |
59 scoped_refptr<WebDatabaseService> web_database_; | 60 scoped_refptr<WebDatabaseService> web_database_; |
60 | 61 |
61 DISALLOW_COPY_AND_ASSIGN(AwFormDatabaseService); | 62 DISALLOW_COPY_AND_ASSIGN(AwFormDatabaseService); |
62 }; | 63 }; |
63 | 64 |
64 } // namespace android_webview | 65 } // namespace android_webview |
65 | 66 |
66 #endif // ANDROID_WEBVIEW_BROWSER_AW_FORM_DATABASE_SERVICE_H_ | 67 #endif // ANDROID_WEBVIEW_BROWSER_AW_FORM_DATABASE_SERVICE_H_ |
OLD | NEW |