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

Unified Diff: ios/chrome/browser/sync/ios_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
« no previous file with comments | « ios/chrome/browser/sync/ios_chrome_sync_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/sync/ios_chrome_sync_client.cc
diff --git a/ios/chrome/browser/sync/ios_chrome_sync_client.cc b/ios/chrome/browser/sync/ios_chrome_sync_client.cc
index be21915f3e5089a11534cd6b7a185c411f55ed2a..e683c481e2536e8506ddb8c34bf1adf7b1cfa43f 100644
--- a/ios/chrome/browser/sync/ios_chrome_sync_client.cc
+++ b/ios/chrome/browser/sync/ios_chrome_sync_client.cc
@@ -134,6 +134,14 @@ IOSChromeSyncClient::~IOSChromeSyncClient() {}
void IOSChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) {
DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI);
+
+ web_data_service_ =
+ ios::WebDataServiceFactory::GetAutofillWebDataForBrowserState(
+ browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
+ // TODO(crbug.com/558320) Is EXPLICIT_ACCESS appropriate here?
+ password_store_ = IOSChromePasswordStoreFactory::GetForBrowserState(
+ browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
+
// Component factory may already be set in tests.
if (!GetSyncApiComponentFactory()) {
const GURL sync_service_url = GetSyncServiceURL(
@@ -151,11 +159,10 @@ void IOSChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) {
prefs::kSavingBrowserHistoryDisabled, sync_service_url,
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI),
web::WebThread::GetTaskRunnerForThread(web::WebThread::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* IOSChromeSyncClient::GetSyncService() {
@@ -192,14 +199,6 @@ autofill::PersonalDataManager* IOSChromeSyncClient::GetPersonalDataManager() {
return PersonalDataManagerFactory::GetForBrowserState(browser_state_);
}
-scoped_refptr<password_manager::PasswordStore>
-IOSChromeSyncClient::GetPasswordStore() {
- DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI);
- // TODO(crbug.com/558320) Is EXPLICIT_ACCESS appropriate here?
- return IOSChromePasswordStoreFactory::GetForBrowserState(
- browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
-}
-
sync_driver::ClearBrowsingDataCallback
IOSChromeSyncClient::GetClearBrowsingDataCallback() {
return base::Bind(&IOSChromeSyncClient::ClearBrowsingData,
@@ -218,13 +217,6 @@ IOSChromeSyncClient::GetRegisterPlatformTypesCallback() {
return sync_driver::SyncApiComponentFactory::RegisterDataTypesMethod();
}
-scoped_refptr<autofill::AutofillWebDataService>
-IOSChromeSyncClient::GetWebDataService() {
- DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI);
- return ios::WebDataServiceFactory::GetAutofillWebDataForBrowserState(
- browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
-}
-
BookmarkUndoService* IOSChromeSyncClient::GetBookmarkUndoServiceIfExists() {
return ios::BookmarkUndoServiceFactory::GetForBrowserStateIfExists(
browser_state_);
@@ -366,11 +358,9 @@ IOSChromeSyncClient::CreateModelWorkerForGroup(
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI), observer);
}
case syncer::GROUP_PASSWORD: {
- scoped_refptr<password_manager::PasswordStore> password_store =
- GetPasswordStore();
- if (!password_store)
+ if (!password_store_)
return nullptr;
- return new browser_sync::PasswordModelWorker(password_store, observer);
+ return new browser_sync::PasswordModelWorker(password_store_, observer);
}
default:
return nullptr;
« no previous file with comments | « ios/chrome/browser/sync/ios_chrome_sync_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698