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

Unified Diff: chrome/browser/sync/chrome_sync_client.cc

Issue 1460723004: [Sync] Remove the last datatype-specific deps from sync_driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete outdated comment. Created 5 years 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/chrome_sync_client.cc
diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc
index 7e389f986c553298b347bc3026b9dbcbb3ead696..b826216abfaaa4b0088d38695fc5f986124cabb0 100644
--- a/chrome/browser/sync/chrome_sync_client.cc
+++ b/chrome/browser/sync/chrome_sync_client.cc
@@ -182,6 +182,13 @@ ChromeSyncClient::~ChromeSyncClient() {
void ChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ web_data_service_ = WebDataServiceFactory::GetAutofillWebDataForProfile(
+ profile_, ServiceAccessType::EXPLICIT_ACCESS);
+ // TODO(crbug.com/558320) Is EXPLICIT_ACCESS appropriate here?
+ password_store_ = PasswordStoreFactory::GetForProfile(
+ profile_, ServiceAccessType::EXPLICIT_ACCESS);
+
// Component factory may already be set in tests.
if (!GetSyncApiComponentFactory()) {
const GURL sync_service_url = GetSyncServiceURL(
@@ -200,11 +207,10 @@ void ChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) {
content::BrowserThread::UI),
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::DB),
- token_service, url_request_context_getter));
+ token_service, url_request_context_getter, web_data_service_,
+ password_store_));
}
sync_service_ = sync_service;
- web_data_service_ = GetWebDataService();
- password_store_ = GetPasswordStore();
}
sync_driver::SyncService* ChromeSyncClient::GetSyncService() {
@@ -241,13 +247,6 @@ autofill::PersonalDataManager* ChromeSyncClient::GetPersonalDataManager() {
return autofill::PersonalDataManagerFactory::GetForProfile(profile_);
}
-scoped_refptr<password_manager::PasswordStore>
-ChromeSyncClient::GetPasswordStore() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- return PasswordStoreFactory::GetForProfile(
- profile_, ServiceAccessType::EXPLICIT_ACCESS);
-}
-
sync_driver::ClearBrowsingDataCallback
ChromeSyncClient::GetClearBrowsingDataCallback() {
return base::Bind(&ChromeSyncClient::ClearBrowsingData,
@@ -271,13 +270,6 @@ ChromeSyncClient::GetRegisterPlatformTypesCallback() {
weak_ptr_factory_.GetWeakPtr());
}
-scoped_refptr<autofill::AutofillWebDataService>
-ChromeSyncClient::GetWebDataService() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- return WebDataServiceFactory::GetAutofillWebDataForProfile(
- profile_, ServiceAccessType::EXPLICIT_ACCESS);
-}
-
BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() {
return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_);
}
@@ -454,11 +446,9 @@ ChromeSyncClient::CreateModelWorkerForGroup(
observer);
}
case syncer::GROUP_PASSWORD: {
- scoped_refptr<password_manager::PasswordStore> password_store =
- GetPasswordStore();
- if (!password_store.get())
+ if (!password_store_.get())
return nullptr;
- return new PasswordModelWorker(password_store, observer);
+ return new PasswordModelWorker(password_store_, observer);
}
default:
return nullptr;
« no previous file with comments | « chrome/browser/sync/chrome_sync_client.h ('k') | chrome/browser/sync/profile_sync_service_autofill_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698