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

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

Issue 14081043: Hook up Autofill Backend interface to SyncableServices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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_profile_syncable_service.cc
diff --git a/chrome/browser/webdata/autofill_profile_syncable_service.cc b/chrome/browser/webdata/autofill_profile_syncable_service.cc
index 9d27656acf59264b254d38118c04a665ed77701d..11e56be4ef72afec14e25d54632e272780f678a7 100644
--- a/chrome/browser/webdata/autofill_profile_syncable_service.cc
+++ b/chrome/browser/webdata/autofill_profile_syncable_service.cc
@@ -11,6 +11,7 @@
#include "components/autofill/browser/autofill_country.h"
#include "components/autofill/browser/autofill_profile.h"
#include "components/autofill/browser/form_group.h"
+#include "components/autofill/browser/webdata/autofill_backend_delegate.h"
#include "components/autofill/browser/webdata/autofill_table.h"
#include "components/autofill/browser/webdata/autofill_webdata_service.h"
#include "components/webdata/common/web_database.h"
@@ -25,6 +26,7 @@ using autofill::AutofillProfile;
using autofill::AutofillProfileChange;
using autofill::AutofillTable;
using autofill::AutofillWebDataService;
+using autofill::AutofillBackendDelegate;
using content::BrowserThread;
namespace {
@@ -49,14 +51,16 @@ const char kAutofillProfileTag[] = "google_chrome_autofill_profiles";
AutofillProfileSyncableService::AutofillProfileSyncableService(
AutofillWebDataService* web_data_service,
+ AutofillBackendDelegate* web_data_delegate,
const std::string& app_locale)
: web_data_service_(web_data_service),
+ web_data_delegate_(web_data_delegate),
app_locale_(app_locale),
ALLOW_THIS_IN_INITIALIZER_LIST(scoped_observer_(this)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
- DCHECK(web_data_service_);
+ DCHECK(web_data_delegate_);
- scoped_observer_.Add(web_data_service_);
+ scoped_observer_.Add(web_data_delegate_);
}
AutofillProfileSyncableService::~AutofillProfileSyncableService() {
@@ -66,10 +70,12 @@ AutofillProfileSyncableService::~AutofillProfileSyncableService() {
// static
void AutofillProfileSyncableService::CreateForWebDataService(
AutofillWebDataService* web_data_service,
+ AutofillBackendDelegate* delegate,
const std::string& app_locale) {
web_data_service->GetDBUserData()->SetUserData(
UserDataKey(),
- new AutofillProfileSyncableService(web_data_service, app_locale));
+ new AutofillProfileSyncableService(
+ web_data_service, delegate, app_locale));
}
// static
@@ -82,6 +88,7 @@ AutofillProfileSyncableService::FromWebDataService(
AutofillProfileSyncableService::AutofillProfileSyncableService()
: web_data_service_(NULL),
+ web_data_delegate_(NULL),
ALLOW_THIS_IN_INITIALIZER_LIST(scoped_observer_(this)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
}
@@ -191,7 +198,8 @@ AutofillProfileSyncableService::MergeDataAndStartSyncing(
sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes));
}
- AutofillWebDataService::NotifyOfMultipleAutofillChanges(web_data_service_);
+ if (web_data_delegate_)
+ web_data_delegate_->NotifyOfMultipleAutofillChanges(web_data_service_);
return merge_result;
}
@@ -262,7 +270,8 @@ syncer::SyncError AutofillProfileSyncableService::ProcessSyncChanges(
"Failed to update webdata.");
}
- AutofillWebDataService::NotifyOfMultipleAutofillChanges(web_data_service_);
+ if (web_data_delegate_)
+ web_data_delegate_->NotifyOfMultipleAutofillChanges(web_data_service_);
return syncer::SyncError();
}
@@ -579,7 +588,7 @@ bool AutofillProfileSyncableService::MergeProfile(
}
AutofillTable* AutofillProfileSyncableService::GetAutofillTable() const {
- return AutofillTable::FromWebDatabase(web_data_service_->GetDatabase());
+ return AutofillTable::FromWebDatabase(web_data_delegate_->GetDatabase());
}
AutofillProfileSyncableService::DataBundle::DataBundle() {}

Powered by Google App Engine
This is Rietveld 408576698