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..39f69adc285c76f720f010106802977de61b5376 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,27 @@ 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_; |
- ProfileSyncComponentsFactoryImpl* const component_factory_; |
+ |
+ // TODO(zea): This is currently a pointer to the "parent" of this class, and |
+ // is therefore not owned, but we should eventually have the SyncClient own |
+ // the component factory (crbug.com/512832). |
+ sync_driver::SyncApiComponentFactory* const component_factory_; |
// 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. |
+ // Note: not owned. |
+ sync_driver::SyncService* sync_service_; |
}; |
} // namespace browser_sync |