Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Unified Diff: chrome/browser/webdata/autofill_web_data_service.h

Issue 12476031: Refactor notifications of chrome/browser/webdata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/webdata/autofill_web_data_service.h
diff --git a/chrome/browser/webdata/autofill_web_data_service.h b/chrome/browser/webdata/autofill_web_data_service.h
index be55351911830704ee4867f86d8d7711f8191806..c2348983f1bb5817f19d1592db2b082c90422342 100644
--- a/chrome/browser/webdata/autofill_web_data_service.h
+++ b/chrome/browser/webdata/autofill_web_data_service.h
@@ -8,25 +8,28 @@
#include <vector>
#include "base/memory/ref_counted.h"
+#include "base/observer_list.h"
#include "chrome/browser/api/webdata/autofill_web_data.h"
#include "chrome/browser/api/webdata/web_data_results.h"
#include "chrome/browser/api/webdata/web_data_service_base.h"
#include "chrome/browser/api/webdata/web_data_service_consumer.h"
#include "chrome/browser/webdata/web_database.h"
+#include "components/autofill/common/form_field_data.h"
class AutofillChange;
+class AutofillProfile;
+class AutofillWebDataServiceObserverOnDBThread;
+class AutofillWebDataServiceObserverOnUIThread;
+class CreditCard;
class WebDatabaseService;
namespace content {
class BrowserContext;
}
-typedef std::vector<AutofillChange> AutofillChangeList;
-
// API for Autofill web data.
-class AutofillWebDataService
- : public AutofillWebData,
- public WebDataServiceBase {
+class AutofillWebDataService : public AutofillWebData,
+ public WebDataServiceBase {
public:
AutofillWebDataService();
@@ -46,9 +49,6 @@ class AutofillWebDataService
static void NotifyOfMultipleAutofillChanges(
AutofillWebDataService* web_data_service);
- // WebDataServiceBase overrides:
- virtual content::NotificationSource GetNotificationSource() OVERRIDE;
-
// AutofillWebData implementation.
virtual void AddFormFields(
const std::vector<FormFieldData>& fields) OVERRIDE;
@@ -75,10 +75,18 @@ class AutofillWebDataService
virtual void RemoveAutofillDataModifiedBetween(
const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE;
+ void AddObserver(AutofillWebDataServiceObserverOnDBThread* observer);
+ void RemoveObserver(AutofillWebDataServiceObserverOnDBThread* observer);
+
+ void AddObserver(AutofillWebDataServiceObserverOnUIThread* observer);
+ void RemoveObserver(AutofillWebDataServiceObserverOnUIThread* observer);
protected:
virtual ~AutofillWebDataService();
+ // WebDataServiceBase overrides:
+ virtual void NotifyDatabaseLoadedOnUIThread() OVERRIDE;
+
private:
WebDatabase::State AddFormElementsImpl(
const std::vector<FormFieldData>& fields, WebDatabase* db);
@@ -113,6 +121,11 @@ class AutofillWebDataService
void DestroyAutofillProfileResult(const WDTypedResult* result);
void DestroyAutofillCreditCardResult(const WDTypedResult* result);
+ void NotifyAutofillMultipleChangedOnUIThread();
+
+ ObserverList<AutofillWebDataServiceObserverOnDBThread> db_observer_list_;
+ ObserverList<AutofillWebDataServiceObserverOnUIThread> ui_observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(AutofillWebDataService);
};
« no previous file with comments | « chrome/browser/webdata/autofill_table_unittest.cc ('k') | chrome/browser/webdata/autofill_web_data_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698