Chromium Code Reviews| Index: chrome/browser/sync/chrome_sync_client.h |
| diff --git a/chrome/browser/sync/chrome_sync_client.h b/chrome/browser/sync/chrome_sync_client.h |
| index 8ee1328632812bcc52a22338840d9f107e6518a9..7afade0746f5c73fd0208b3b223e1ac0090fdfef 100644 |
| --- a/chrome/browser/sync/chrome_sync_client.h |
| +++ b/chrome/browser/sync/chrome_sync_client.h |
| @@ -7,17 +7,26 @@ |
| #include "components/sync_driver/sync_client.h" |
| -class ProfileSyncComponentsFactoryImpl; |
| +class Profile; |
| + |
| +namespace sync_driver { |
| +class SyncApiComponentFactory; |
| +class SyncService; |
| +} |
| namespace browser_sync { |
| class ChromeSyncClient : public sync_driver::SyncClient { |
| public: |
| ChromeSyncClient(Profile* profile, |
| - ProfileSyncComponentsFactoryImpl* component_factory); |
| + sync_driver::SyncApiComponentFactory* component_factory); |
| ~ChromeSyncClient() override; |
| + // Initializes the ChromeSyncClient internal state. |
| + void Initialize(sync_driver::SyncService* sync_service); |
| + |
| // SyncClient implementation. |
| + sync_driver::SyncService* GetSyncService() override; |
| PrefService* GetPrefService() override; |
| bookmarks::BookmarkModel* GetBookmarkModel() override; |
| history::HistoryService* GetHistoryService() override; |
| @@ -26,52 +35,21 @@ class ChromeSyncClient : public sync_driver::SyncClient { |
| scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() override; |
| base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( |
| syncer::ModelType type) override; |
| - // TODO(zea): crbug.com/512768 Move the rest of these methods into |
| - // SyncApiComponentFactoryImpl (all of these methods currently delegate to |
| - // |component_factory_|), which will replace ProfileSyncComponentsFactoryImpl. |
| - scoped_ptr<syncer::AttachmentService> CreateAttachmentService( |
| - scoped_ptr<syncer::AttachmentStoreForSync> attachment_store, |
| - const syncer::UserShare& user_share, |
| - const std::string& store_birthday, |
| - syncer::ModelType model_type, |
| - syncer::AttachmentService::Delegate* delegate) override; |
| - void RegisterDataTypes(ProfileSyncService* pss) override; |
| - sync_driver::DataTypeManager* CreateDataTypeManager( |
| - const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
| - debug_info_listener, |
| - const sync_driver::DataTypeController::TypeMap* controllers, |
| - const sync_driver::DataTypeEncryptionHandler* encryption_handler, |
| - browser_sync::SyncBackendHost* backend, |
| - sync_driver::DataTypeManagerObserver* observer) override; |
| - browser_sync::SyncBackendHost* CreateSyncBackendHost( |
| - const std::string& name, |
| - Profile* profile, |
| - invalidation::InvalidationService* invalidator, |
| - const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, |
| - const base::FilePath& sync_folder) override; |
| - scoped_ptr<sync_driver::LocalDeviceInfoProvider> |
| - CreateLocalDeviceInfoProvider() override; |
| - ProfileSyncComponentsFactory::SyncComponents CreateBookmarkSyncComponents( |
| - ProfileSyncService* profile_sync_service, |
| - sync_driver::DataTypeErrorHandler* error_handler) override; |
| - ProfileSyncComponentsFactory::SyncComponents CreateTypedUrlSyncComponents( |
| - ProfileSyncService* profile_sync_service, |
| - history::HistoryBackend* history_backend, |
| - sync_driver::DataTypeErrorHandler* error_handler) override; |
| - |
| - // TODO(zea): crbug.com/512768 Convert this to SyncApiComponentFactoryImpl |
| - // and make it part of the SyncClient interface. |
| - ProfileSyncComponentsFactoryImpl* GetProfileSyncComponentsFactoryImpl(); |
| + sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override; |
| private: |
| Profile* const profile_; |
|
stanisc
2015/08/27 22:14:04
I wonder if SyncClient should have a method that r
Nicolas Zea
2015/08/27 23:37:15
Most places that a profile is passed with the Sync
|
| - ProfileSyncComponentsFactoryImpl* const component_factory_; |
| + sync_driver::SyncApiComponentFactory* const component_factory_; |
|
stanisc
2015/08/27 22:14:04
Consider adding a comment about ownership of compo
Nicolas Zea
2015/08/27 23:37:15
Done.
|
| // Members that must be fetched on the UI thread but accessed on their |
| // respective backend threads. |
| scoped_refptr<autofill::AutofillWebDataService> web_data_service_; |
| scoped_refptr<password_manager::PasswordStore> password_store_; |
| + // TODO(zea): this is a member only because Typed URLs needs access to |
| + // the UserShare and Cryptographer outside of the UI thread. Remove this |
| + // once that's no longer the case. |
| + sync_driver::SyncService* sync_service_; |
|
stanisc
2015/08/27 22:14:04
Consider mentioning ownership of sync_service.
Nicolas Zea
2015/08/27 23:37:15
Done.
|
| }; |
| } // namespace browser_sync |