| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_WEBDATA_SERVICE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_WEBDATA_SERVICE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_WEBDATA_SERVICE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_WEBDATA_SERVICE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "base/supports_user_data.h" | 14 #include "base/supports_user_data.h" |
| 15 #include "components/autofill/core/browser/webdata/autofill_webdata.h" | 15 #include "components/autofill/core/browser/webdata/autofill_webdata.h" |
| 16 #include "components/autofill/core/common/form_field_data.h" | 16 #include "components/autofill/core/common/form_field_data.h" |
| 17 #include "components/webdata/common/web_data_results.h" | 17 #include "components/webdata/common/web_data_results.h" |
| 18 #include "components/webdata/common/web_data_service_base.h" | 18 #include "components/webdata/common/web_data_service_base.h" |
| 19 #include "components/webdata/common/web_data_service_consumer.h" | 19 #include "components/webdata/common/web_data_service_consumer.h" |
| 20 #include "components/webdata/common/web_database.h" | 20 #include "components/webdata/common/web_database.h" |
| 21 #include "sync/internal_api/public/base/model_type.h" |
| 21 | 22 |
| 22 class WebDatabaseService; | 23 class WebDatabaseService; |
| 23 | 24 |
| 24 namespace base { | 25 namespace base { |
| 25 class SingleThreadTaskRunner; | 26 class SingleThreadTaskRunner; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace autofill { | 29 namespace autofill { |
| 29 | 30 |
| 30 class AutofillChange; | 31 class AutofillChange; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // |AutofillWebdataBackend|. This backend can be used to access or update the | 123 // |AutofillWebdataBackend|. This backend can be used to access or update the |
| 123 // WebDatabase directly on the DB thread. | 124 // WebDatabase directly on the DB thread. |
| 124 void GetAutofillBackend( | 125 void GetAutofillBackend( |
| 125 const base::Callback<void(AutofillWebDataBackend*)>& callback); | 126 const base::Callback<void(AutofillWebDataBackend*)>& callback); |
| 126 | 127 |
| 127 protected: | 128 protected: |
| 128 ~AutofillWebDataService() override; | 129 ~AutofillWebDataService() override; |
| 129 | 130 |
| 130 virtual void NotifyAutofillMultipleChangedOnUIThread(); | 131 virtual void NotifyAutofillMultipleChangedOnUIThread(); |
| 131 | 132 |
| 133 virtual void NotifySyncStartedOnUIThread(syncer::ModelType model_type); |
| 134 |
| 132 base::WeakPtr<AutofillWebDataService> AsWeakPtr() { | 135 base::WeakPtr<AutofillWebDataService> AsWeakPtr() { |
| 133 return weak_ptr_factory_.GetWeakPtr(); | 136 return weak_ptr_factory_.GetWeakPtr(); |
| 134 } | 137 } |
| 135 | 138 |
| 136 private: | 139 private: |
| 137 base::ObserverList<AutofillWebDataServiceObserverOnUIThread> | 140 base::ObserverList<AutofillWebDataServiceObserverOnUIThread> |
| 138 ui_observer_list_; | 141 ui_observer_list_; |
| 139 | 142 |
| 140 // The task runner that this class uses as its UI thread. | 143 // The task runner that this class uses as its UI thread. |
| 141 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_; | 144 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_; |
| 142 | 145 |
| 143 // The task runner that this class uses as its DB thread. | 146 // The task runner that this class uses as its DB thread. |
| 144 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; | 147 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; |
| 145 | 148 |
| 146 scoped_refptr<AutofillWebDataBackendImpl> autofill_backend_; | 149 scoped_refptr<AutofillWebDataBackendImpl> autofill_backend_; |
| 147 | 150 |
| 148 // This factory is used on the UI thread. All vended weak pointers are | 151 // This factory is used on the UI thread. All vended weak pointers are |
| 149 // invalidated in ShutdownOnUIThread(). | 152 // invalidated in ShutdownOnUIThread(). |
| 150 base::WeakPtrFactory<AutofillWebDataService> weak_ptr_factory_; | 153 base::WeakPtrFactory<AutofillWebDataService> weak_ptr_factory_; |
| 151 | 154 |
| 152 DISALLOW_COPY_AND_ASSIGN(AutofillWebDataService); | 155 DISALLOW_COPY_AND_ASSIGN(AutofillWebDataService); |
| 153 }; | 156 }; |
| 154 | 157 |
| 155 } // namespace autofill | 158 } // namespace autofill |
| 156 | 159 |
| 157 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_WEBDATA_SERVICE_H_ | 160 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_WEBDATA_SERVICE_H_ |
| OLD | NEW |