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

Unified Diff: chrome/browser/webdata/web_data_service.cc

Issue 7967024: Profile shouldn't own PersonalDataManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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/web_data_service.cc
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index 1f6e6ce89490fc0131686beab5f55897c2a0041a..ca76358795a824259f55991c7dd0af9b31456538 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -42,6 +42,36 @@ using base::Time;
using webkit_glue::FormField;
using webkit_glue::PasswordForm;
+namespace {
+// A task used by WebDataService (for Sync mainly) to inform the
+// PersonalDataManager living on the UI thread that it needs to refresh.
+class NotifyOfMultipleAutofillChangesTask : public Task {
+ public:
+ explicit NotifyOfMultipleAutofillChangesTask(
+ WebDataService* web_data_service);
+ virtual ~NotifyOfMultipleAutofillChangesTask();
+ virtual void Run();
+ private:
+ WebDataService* web_data_service_;
+};
+
+NotifyOfMultipleAutofillChangesTask::NotifyOfMultipleAutofillChangesTask(
+ WebDataService* web_data_service) : web_data_service_(web_data_service) {
+}
+
+NotifyOfMultipleAutofillChangesTask::~NotifyOfMultipleAutofillChangesTask() {}
+
+void NotifyOfMultipleAutofillChangesTask::Run() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_AUTOFILL_MULTIPLE_CHANGED,
+ Source<WebDataService>(web_data_service_),
+ NotificationService::NoDetails());
+}
+
+} // namespace
+
WDAppImagesResult::WDAppImagesResult() : has_all_images(false) {}
WDAppImagesResult::~WDAppImagesResult() {}
@@ -559,6 +589,12 @@ void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetween(
request));
}
+void WebDataService::NotifyOfMultipleAutofillChanges() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ new NotifyOfMultipleAutofillChangesTask(this));
+}
+
WebDataService::~WebDataService() {
if (is_running_ && db_) {
DLOG_ASSERT("WebDataService dtor called without Shutdown");

Powered by Google App Engine
This is Rietveld 408576698