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

Unified Diff: chrome/browser/sync/glue/autofill_profile_syncable_service.cc

Issue 7967024: Profile shouldn't own PersonalDataManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addresses isherman #11 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/sync/glue/autofill_profile_syncable_service.cc
diff --git a/chrome/browser/sync/glue/autofill_profile_syncable_service.cc b/chrome/browser/sync/glue/autofill_profile_syncable_service.cc
index aef0e43699a4457359edd34194b8289fd98ae012..b0bcb7d9f2fe8b34d46be5b405811d85db71c445 100644
--- a/chrome/browser/sync/glue/autofill_profile_syncable_service.cc
+++ b/chrome/browser/sync/glue/autofill_profile_syncable_service.cc
@@ -7,13 +7,16 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/autofill/autofill_profile.h"
+#include "chrome/browser/autofill/form_group.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/api/sync_error.h"
-#include "chrome/browser/sync/glue/do_optimistic_refresh_task.h"
#include "chrome/browser/webdata/autofill_table.h"
#include "chrome/browser/webdata/web_database.h"
+#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/guid.h"
+#include "content/browser/browser_thread.h"
#include "content/common/notification_service.h"
namespace {
@@ -37,19 +40,17 @@ const char kAutofillProfileTag[] = "google_chrome_autofill_profiles";
AutofillProfileSyncableService::AutofillProfileSyncableService(
WebDatabase* web_database,
- PersonalDataManager* personal_data,
Profile* profile)
: web_database_(web_database),
- personal_data_(personal_data),
+ profile_(profile),
sync_processor_(NULL) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
DCHECK(web_database_);
- DCHECK(personal_data_);
DCHECK(profile);
notification_registrar_.Add(this,
chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(
- profile->GetWebDataService(Profile::EXPLICIT_ACCESS)));
+ profile_->GetWebDataService(Profile::EXPLICIT_ACCESS)));
}
AutofillProfileSyncableService::~AutofillProfileSyncableService() {
@@ -58,7 +59,7 @@ AutofillProfileSyncableService::~AutofillProfileSyncableService() {
AutofillProfileSyncableService::AutofillProfileSyncableService()
: web_database_(NULL),
- personal_data_(NULL),
+ profile_(NULL),
sync_processor_(NULL) {
}
@@ -119,8 +120,7 @@ SyncError AutofillProfileSyncableService::MergeDataAndStartSyncing(
SyncError error = sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes);
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- new DoOptimisticRefreshForAutofill(personal_data_));
+ WebDataService::NotifyOfMultipleAutofillChanges(profile_);
return error;
}
@@ -188,8 +188,8 @@ SyncError AutofillProfileSyncableService::ProcessSyncChanges(
if (!SaveChangesToWebData(bundle))
return SyncError(FROM_HERE, "Failed to update webdata.", model_type());
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- new DoOptimisticRefreshForAutofill(personal_data_));
+ WebDataService::NotifyOfMultipleAutofillChanges(profile_);
+
return SyncError();
}

Powered by Google App Engine
This is Rietveld 408576698